@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.
Files changed (516) hide show
  1. package/.conf/tsconfig.base.json +79 -0
  2. package/.conf/tsconfig.browser.json +32 -0
  3. package/.conf/tsconfig.node.json +33 -0
  4. package/LICENSE +10 -19
  5. package/dist/browser/index.d.mts +1699 -0
  6. package/dist/browser/index.mjs +2935 -0
  7. package/dist/browser/index.mjs.map +1 -0
  8. package/dist/node/A-Request.entity-8_9MCXT2.d.ts +533 -0
  9. package/dist/node/A-Request.entity-r905O60G.d.mts +533 -0
  10. package/dist/node/A-Response.entity-6qhiV7BE.d.mts +348 -0
  11. package/dist/node/A-Response.entity-bjh6bofZ.d.ts +348 -0
  12. package/dist/node/channels/A-Http/A-Http.channel.constants.d.mts +9 -0
  13. package/dist/node/channels/A-Http/A-Http.channel.constants.d.ts +9 -0
  14. package/dist/node/channels/A-Http/A-Http.channel.constants.js +13 -0
  15. package/dist/node/channels/A-Http/A-Http.channel.constants.js.map +1 -0
  16. package/dist/node/channels/A-Http/A-Http.channel.constants.mjs +12 -0
  17. package/dist/node/channels/A-Http/A-Http.channel.constants.mjs.map +1 -0
  18. package/dist/node/channels/A-Http/A-Http.channel.d.mts +23 -0
  19. package/dist/node/channels/A-Http/A-Http.channel.d.ts +23 -0
  20. package/dist/node/channels/A-Http/A-Http.channel.error.d.mts +7 -0
  21. package/dist/node/channels/A-Http/A-Http.channel.error.d.ts +7 -0
  22. package/dist/node/channels/A-Http/A-Http.channel.error.js +11 -0
  23. package/dist/node/channels/A-Http/A-Http.channel.error.js.map +1 -0
  24. package/dist/node/channels/A-Http/A-Http.channel.error.mjs +10 -0
  25. package/dist/node/channels/A-Http/A-Http.channel.error.mjs.map +1 -0
  26. package/dist/node/channels/A-Http/A-Http.channel.js +122 -0
  27. package/dist/node/channels/A-Http/A-Http.channel.js.map +1 -0
  28. package/dist/node/channels/A-Http/A-Http.channel.mjs +110 -0
  29. package/dist/node/channels/A-Http/A-Http.channel.mjs.map +1 -0
  30. package/dist/node/channels/A-Http/A-Http.channel.types.d.mts +67 -0
  31. package/dist/node/channels/A-Http/A-Http.channel.types.d.ts +67 -0
  32. package/dist/node/channels/A-Http/A-Http.channel.types.js +4 -0
  33. package/dist/node/channels/A-Http/A-Http.channel.types.js.map +1 -0
  34. package/dist/node/channels/A-Http/A-Http.channel.types.mjs +3 -0
  35. package/dist/node/channels/A-Http/A-Http.channel.types.mjs.map +1 -0
  36. package/dist/node/channels/A-Websockets/A-Websockets.channel.d.mts +7 -0
  37. package/dist/node/channels/A-Websockets/A-Websockets.channel.d.ts +7 -0
  38. package/dist/node/channels/A-Websockets/A-Websockets.channel.js +13 -0
  39. package/dist/node/channels/A-Websockets/A-Websockets.channel.js.map +1 -0
  40. package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs +12 -0
  41. package/dist/node/channels/A-Websockets/A-Websockets.channel.mjs.map +1 -0
  42. package/dist/node/chunk-EQQGB2QZ.mjs +15 -0
  43. package/dist/node/chunk-EQQGB2QZ.mjs.map +1 -0
  44. package/dist/node/constants/env.constants.d.mts +12 -0
  45. package/dist/node/constants/env.constants.d.ts +12 -0
  46. package/dist/node/constants/env.constants.js +23 -0
  47. package/dist/node/constants/env.constants.js.map +1 -0
  48. package/dist/node/constants/env.constants.mjs +22 -0
  49. package/dist/node/constants/env.constants.mjs.map +1 -0
  50. package/dist/node/controllers/A-CommandController/A-CommandController.component.d.mts +29 -0
  51. package/dist/node/controllers/A-CommandController/A-CommandController.component.d.ts +29 -0
  52. package/dist/node/controllers/A-CommandController/A-CommandController.component.js +55 -0
  53. package/dist/node/controllers/A-CommandController/A-CommandController.component.js.map +1 -0
  54. package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs +43 -0
  55. package/dist/node/controllers/A-CommandController/A-CommandController.component.mjs.map +1 -0
  56. package/dist/node/controllers/A-EntityController/A-EntityController.component.d.mts +44 -0
  57. package/dist/node/controllers/A-EntityController/A-EntityController.component.d.ts +44 -0
  58. package/dist/node/controllers/A-EntityController/A-EntityController.component.js +189 -0
  59. package/dist/node/controllers/A-EntityController/A-EntityController.component.js.map +1 -0
  60. package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs +177 -0
  61. package/dist/node/controllers/A-EntityController/A-EntityController.component.mjs.map +1 -0
  62. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.mts +2 -0
  63. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.d.ts +2 -0
  64. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js +4 -0
  65. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.js.map +1 -0
  66. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs +3 -0
  67. package/dist/node/controllers/A-EntityController/A-EntityController.component.types.mjs.map +1 -0
  68. package/dist/node/controllers/A-ListingController/A-ListingController.component.d.mts +28 -0
  69. package/dist/node/controllers/A-ListingController/A-ListingController.component.d.ts +28 -0
  70. package/dist/node/controllers/A-ListingController/A-ListingController.component.js +59 -0
  71. package/dist/node/controllers/A-ListingController/A-ListingController.component.js.map +1 -0
  72. package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs +47 -0
  73. package/dist/node/controllers/A-ListingController/A-ListingController.component.mjs.map +1 -0
  74. package/dist/node/controllers/A-ListingController/A-ListingController.types.d.mts +2 -0
  75. package/dist/node/controllers/A-ListingController/A-ListingController.types.d.ts +2 -0
  76. package/dist/node/controllers/A-ListingController/A-ListingController.types.js +4 -0
  77. package/dist/node/controllers/A-ListingController/A-ListingController.types.js.map +1 -0
  78. package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs +3 -0
  79. package/dist/node/controllers/A-ListingController/A-ListingController.types.mjs.map +1 -0
  80. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.mts +30 -0
  81. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.d.ts +30 -0
  82. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js +46 -0
  83. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.js.map +1 -0
  84. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs +34 -0
  85. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.component.mjs.map +1 -0
  86. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.mts +2 -0
  87. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.d.ts +2 -0
  88. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js +4 -0
  89. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.js.map +1 -0
  90. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs +3 -0
  91. package/dist/node/controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.mjs.map +1 -0
  92. package/dist/node/index.d.mts +51 -0
  93. package/dist/node/index.d.ts +51 -0
  94. package/dist/node/index.js +320 -0
  95. package/dist/node/index.js.map +1 -0
  96. package/dist/node/index.mjs +48 -0
  97. package/dist/node/index.mjs.map +1 -0
  98. package/dist/node/lib/A-Request/A-HttpRequestData.context.d.mts +12 -0
  99. package/dist/node/lib/A-Request/A-HttpRequestData.context.d.ts +12 -0
  100. package/dist/node/lib/A-Request/A-HttpRequestData.context.js +25 -0
  101. package/dist/node/lib/A-Request/A-HttpRequestData.context.js.map +1 -0
  102. package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs +24 -0
  103. package/dist/node/lib/A-Request/A-HttpRequestData.context.mjs.map +1 -0
  104. package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.mts +39 -0
  105. package/dist/node/lib/A-Request/A-HttpServerRequest.context.d.ts +39 -0
  106. package/dist/node/lib/A-Request/A-HttpServerRequest.context.js +56 -0
  107. package/dist/node/lib/A-Request/A-HttpServerRequest.context.js.map +1 -0
  108. package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs +55 -0
  109. package/dist/node/lib/A-Request/A-HttpServerRequest.context.mjs.map +1 -0
  110. package/dist/node/lib/A-Request/A-Request.constants.d.mts +18 -0
  111. package/dist/node/lib/A-Request/A-Request.constants.d.ts +18 -0
  112. package/dist/node/lib/A-Request/A-Request.constants.js +22 -0
  113. package/dist/node/lib/A-Request/A-Request.constants.js.map +1 -0
  114. package/dist/node/lib/A-Request/A-Request.constants.mjs +22 -0
  115. package/dist/node/lib/A-Request/A-Request.constants.mjs.map +1 -0
  116. package/dist/node/lib/A-Request/A-Request.entity.d.mts +17 -0
  117. package/dist/node/lib/A-Request/A-Request.entity.d.ts +17 -0
  118. package/dist/node/lib/A-Request/A-Request.entity.js +651 -0
  119. package/dist/node/lib/A-Request/A-Request.entity.js.map +1 -0
  120. package/dist/node/lib/A-Request/A-Request.entity.mjs +639 -0
  121. package/dist/node/lib/A-Request/A-Request.entity.mjs.map +1 -0
  122. package/dist/node/lib/A-Request/A-Request.env.d.mts +37 -0
  123. package/dist/node/lib/A-Request/A-Request.env.d.ts +37 -0
  124. package/dist/node/lib/A-Request/A-Request.env.js +39 -0
  125. package/dist/node/lib/A-Request/A-Request.env.js.map +1 -0
  126. package/dist/node/lib/A-Request/A-Request.env.mjs +38 -0
  127. package/dist/node/lib/A-Request/A-Request.env.mjs.map +1 -0
  128. package/dist/node/lib/A-Request/A-Request.error.d.mts +11 -0
  129. package/dist/node/lib/A-Request/A-Request.error.d.ts +11 -0
  130. package/dist/node/lib/A-Request/A-Request.error.js +15 -0
  131. package/dist/node/lib/A-Request/A-Request.error.js.map +1 -0
  132. package/dist/node/lib/A-Request/A-Request.error.mjs +14 -0
  133. package/dist/node/lib/A-Request/A-Request.error.mjs.map +1 -0
  134. package/dist/node/lib/A-Request/A-Request.helper.d.mts +105 -0
  135. package/dist/node/lib/A-Request/A-Request.helper.d.ts +105 -0
  136. package/dist/node/lib/A-Request/A-Request.helper.js +181 -0
  137. package/dist/node/lib/A-Request/A-Request.helper.js.map +1 -0
  138. package/dist/node/lib/A-Request/A-Request.helper.mjs +180 -0
  139. package/dist/node/lib/A-Request/A-Request.helper.mjs.map +1 -0
  140. package/dist/node/lib/A-Request/A-Request.types.d.mts +17 -0
  141. package/dist/node/lib/A-Request/A-Request.types.d.ts +17 -0
  142. package/dist/node/lib/A-Request/A-Request.types.js +14 -0
  143. package/dist/node/lib/A-Request/A-Request.types.js.map +1 -0
  144. package/dist/node/lib/A-Request/A-Request.types.mjs +14 -0
  145. package/dist/node/lib/A-Request/A-Request.types.mjs.map +1 -0
  146. package/dist/node/lib/A-Response/A-Response.constants.d.mts +24 -0
  147. package/dist/node/lib/A-Response/A-Response.constants.d.ts +24 -0
  148. package/dist/node/lib/A-Response/A-Response.constants.js +28 -0
  149. package/dist/node/lib/A-Response/A-Response.constants.js.map +1 -0
  150. package/dist/node/lib/A-Response/A-Response.constants.mjs +28 -0
  151. package/dist/node/lib/A-Response/A-Response.constants.mjs.map +1 -0
  152. package/dist/node/lib/A-Response/A-Response.entity.d.mts +20 -0
  153. package/dist/node/lib/A-Response/A-Response.entity.d.ts +20 -0
  154. package/dist/node/lib/A-Response/A-Response.entity.js +608 -0
  155. package/dist/node/lib/A-Response/A-Response.entity.js.map +1 -0
  156. package/dist/node/lib/A-Response/A-Response.entity.mjs +596 -0
  157. package/dist/node/lib/A-Response/A-Response.entity.mjs.map +1 -0
  158. package/dist/node/lib/A-Response/A-Response.env.d.mts +2 -0
  159. package/dist/node/lib/A-Response/A-Response.env.d.ts +2 -0
  160. package/dist/node/lib/A-Response/A-Response.env.js +4 -0
  161. package/dist/node/lib/A-Response/A-Response.env.js.map +1 -0
  162. package/dist/node/lib/A-Response/A-Response.env.mjs +3 -0
  163. package/dist/node/lib/A-Response/A-Response.env.mjs.map +1 -0
  164. package/dist/node/lib/A-Response/A-Response.error.d.mts +6 -0
  165. package/dist/node/lib/A-Response/A-Response.error.d.ts +6 -0
  166. package/dist/node/lib/A-Response/A-Response.error.js +10 -0
  167. package/dist/node/lib/A-Response/A-Response.error.js.map +1 -0
  168. package/dist/node/lib/A-Response/A-Response.error.mjs +9 -0
  169. package/dist/node/lib/A-Response/A-Response.error.mjs.map +1 -0
  170. package/dist/node/lib/A-Response/A-Response.types.d.mts +20 -0
  171. package/dist/node/lib/A-Response/A-Response.types.d.ts +20 -0
  172. package/dist/node/lib/A-Response/A-Response.types.js +4 -0
  173. package/dist/node/lib/A-Response/A-Response.types.js.map +1 -0
  174. package/dist/node/lib/A-Response/A-Response.types.mjs +3 -0
  175. package/dist/node/lib/A-Response/A-Response.types.mjs.map +1 -0
  176. package/dist/node/lib/A-Server/A-HttpServer.constants.d.mts +7 -0
  177. package/dist/node/lib/A-Server/A-HttpServer.constants.d.ts +7 -0
  178. package/dist/node/lib/A-Server/A-HttpServer.constants.js +11 -0
  179. package/dist/node/lib/A-Server/A-HttpServer.constants.js.map +1 -0
  180. package/dist/node/lib/A-Server/A-HttpServer.constants.mjs +11 -0
  181. package/dist/node/lib/A-Server/A-HttpServer.constants.mjs.map +1 -0
  182. package/dist/node/lib/A-Server/A-HttpServer.container.d.mts +50 -0
  183. package/dist/node/lib/A-Server/A-HttpServer.container.d.ts +50 -0
  184. package/dist/node/lib/A-Server/A-HttpServer.container.js +196 -0
  185. package/dist/node/lib/A-Server/A-HttpServer.container.js.map +1 -0
  186. package/dist/node/lib/A-Server/A-HttpServer.container.mjs +184 -0
  187. package/dist/node/lib/A-Server/A-HttpServer.container.mjs.map +1 -0
  188. package/dist/node/lib/A-Server/A-HttpServer.error.d.mts +54 -0
  189. package/dist/node/lib/A-Server/A-HttpServer.error.d.ts +54 -0
  190. package/dist/node/lib/A-Server/A-HttpServer.error.js +118 -0
  191. package/dist/node/lib/A-Server/A-HttpServer.error.js.map +1 -0
  192. package/dist/node/lib/A-Server/A-HttpServer.error.mjs +117 -0
  193. package/dist/node/lib/A-Server/A-HttpServer.error.mjs.map +1 -0
  194. package/dist/node/lib/A-Server/A-HttpServer.types.d.mts +19 -0
  195. package/dist/node/lib/A-Server/A-HttpServer.types.d.ts +19 -0
  196. package/dist/node/lib/A-Server/A-HttpServer.types.js +4 -0
  197. package/dist/node/lib/A-Server/A-HttpServer.types.js.map +1 -0
  198. package/dist/node/lib/A-Server/A-HttpServer.types.mjs +3 -0
  199. package/dist/node/lib/A-Server/A-HttpServer.types.mjs.map +1 -0
  200. package/dist/node/lib/A-Server/A-Server.context.d.mts +22 -0
  201. package/dist/node/lib/A-Server/A-Server.context.d.ts +22 -0
  202. package/dist/node/lib/A-Server/A-Server.context.js +24 -0
  203. package/dist/node/lib/A-Server/A-Server.context.js.map +1 -0
  204. package/dist/node/lib/A-Server/A-Server.context.mjs +23 -0
  205. package/dist/node/lib/A-Server/A-Server.context.mjs.map +1 -0
  206. package/dist/node/lib/A-Server/A-Server.error.d.mts +14 -0
  207. package/dist/node/lib/A-Server/A-Server.error.d.ts +14 -0
  208. package/dist/node/lib/A-Server/A-Server.error.js +26 -0
  209. package/dist/node/lib/A-Server/A-Server.error.js.map +1 -0
  210. package/dist/node/lib/A-Server/A-Server.error.mjs +25 -0
  211. package/dist/node/lib/A-Server/A-Server.error.mjs.map +1 -0
  212. package/dist/node/lib/A-Server/A-Server.types.d.mts +26 -0
  213. package/dist/node/lib/A-Server/A-Server.types.d.ts +26 -0
  214. package/dist/node/lib/A-Server/A-Server.types.js +4 -0
  215. package/dist/node/lib/A-Server/A-Server.types.js.map +1 -0
  216. package/dist/node/lib/A-Server/A-Server.types.mjs +3 -0
  217. package/dist/node/lib/A-Server/A-Server.types.mjs.map +1 -0
  218. package/dist/node/lib/A-ServerController/A-ServerController.component.d.mts +29 -0
  219. package/dist/node/lib/A-ServerController/A-ServerController.component.d.ts +29 -0
  220. package/dist/node/lib/A-ServerController/A-ServerController.component.js +49 -0
  221. package/dist/node/lib/A-ServerController/A-ServerController.component.js.map +1 -0
  222. package/dist/node/lib/A-ServerController/A-ServerController.component.mjs +37 -0
  223. package/dist/node/lib/A-ServerController/A-ServerController.component.mjs.map +1 -0
  224. package/dist/node/lib/A-ServerController/A-ServerController.types.d.mts +2 -0
  225. package/dist/node/lib/A-ServerController/A-ServerController.types.d.ts +2 -0
  226. package/dist/node/lib/A-ServerController/A-ServerController.types.js +4 -0
  227. package/dist/node/lib/A-ServerController/A-ServerController.types.js.map +1 -0
  228. package/dist/node/lib/A-ServerController/A-ServerController.types.mjs +3 -0
  229. package/dist/node/lib/A-ServerController/A-ServerController.types.mjs.map +1 -0
  230. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.mts +49 -0
  231. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.d.ts +49 -0
  232. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js +91 -0
  233. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.js.map +1 -0
  234. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs +90 -0
  235. package/dist/node/lib/A-ServerEntityList/A-EntityList.entity.mjs.map +1 -0
  236. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.mts +22 -0
  237. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.d.ts +22 -0
  238. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js +10 -0
  239. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.js.map +1 -0
  240. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs +10 -0
  241. package/dist/node/lib/A-ServerEntityList/A-EntityList.types.mjs.map +1 -0
  242. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.mts +13 -0
  243. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.d.ts +13 -0
  244. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js +32 -0
  245. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.js.map +1 -0
  246. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs +31 -0
  247. package/dist/node/lib/A-ServerListQuery/A-ServerListQueryFilter.context.mjs.map +1 -0
  248. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.mts +48 -0
  249. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.d.ts +48 -0
  250. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js +88 -0
  251. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.js.map +1 -0
  252. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs +76 -0
  253. package/dist/node/lib/A-ServerLogger/A-ServerLogger.component.mjs.map +1 -0
  254. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.mts +24 -0
  255. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.d.ts +24 -0
  256. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js +33 -0
  257. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.js.map +1 -0
  258. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs +33 -0
  259. package/dist/node/lib/A-ServerLogger/A-ServerLogger.constants.mjs.map +1 -0
  260. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.mts +12 -0
  261. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.d.ts +12 -0
  262. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js +4 -0
  263. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.js.map +1 -0
  264. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs +3 -0
  265. package/dist/node/lib/A-ServerLogger/A-ServerLogger.types.mjs.map +1 -0
  266. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.mts +6 -0
  267. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.d.ts +6 -0
  268. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js +18 -0
  269. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.js.map +1 -0
  270. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs +17 -0
  271. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.component.mjs.map +1 -0
  272. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.mts +2 -0
  273. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.d.ts +2 -0
  274. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js +4 -0
  275. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.js.map +1 -0
  276. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs +3 -0
  277. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.constants.mjs.map +1 -0
  278. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.mts +2 -0
  279. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.d.ts +2 -0
  280. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js +4 -0
  281. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.js.map +1 -0
  282. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs +3 -0
  283. package/dist/node/lib/A-ServerMiddleware/A-ServerMiddleware.types.mjs.map +1 -0
  284. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.mts +31 -0
  285. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.d.ts +31 -0
  286. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js +90 -0
  287. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.js.map +1 -0
  288. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs +78 -0
  289. package/dist/node/lib/A-ServerProxy/A-ServerProxy.component.mjs.map +1 -0
  290. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.mts +9 -0
  291. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.d.ts +9 -0
  292. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js +14 -0
  293. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.js.map +1 -0
  294. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs +14 -0
  295. package/dist/node/lib/A-ServerProxy/A-ServerProxy.constants.mjs.map +1 -0
  296. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.mts +36 -0
  297. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.d.ts +36 -0
  298. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js +60 -0
  299. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.js.map +1 -0
  300. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs +59 -0
  301. package/dist/node/lib/A-ServerProxy/A-ServerProxy.context.mjs.map +1 -0
  302. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.mts +23 -0
  303. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.d.ts +23 -0
  304. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js +4 -0
  305. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.js.map +1 -0
  306. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs +3 -0
  307. package/dist/node/lib/A-ServerProxy/A-ServerProxy.types.mjs.map +1 -0
  308. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.mts +20 -0
  309. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.d.ts +20 -0
  310. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js +25 -0
  311. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.js.map +1 -0
  312. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs +24 -0
  313. package/dist/node/lib/A-ServerRoute/A-ServerRoute.constants.mjs.map +1 -0
  314. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.mts +15 -0
  315. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.d.ts +15 -0
  316. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js +24 -0
  317. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.js.map +1 -0
  318. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs +23 -0
  319. package/dist/node/lib/A-ServerRoute/A-ServerRoute.entity.mjs.map +1 -0
  320. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.mts +6 -0
  321. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.d.ts +6 -0
  322. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js +4 -0
  323. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.js.map +1 -0
  324. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs +3 -0
  325. package/dist/node/lib/A-ServerRoute/A-ServerRoute.types.mjs.map +1 -0
  326. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.mts +84 -0
  327. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.d.ts +84 -0
  328. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js +194 -0
  329. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.js.map +1 -0
  330. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs +184 -0
  331. package/dist/node/lib/A-ServerRouter/A-ServerRouter.component.mjs.map +1 -0
  332. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.mts +6 -0
  333. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.d.ts +6 -0
  334. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js +10 -0
  335. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.js.map +1 -0
  336. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs +10 -0
  337. package/dist/node/lib/A-ServerRouter/A-ServerRouter.constants.mjs.map +1 -0
  338. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.mts +16 -0
  339. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.d.ts +16 -0
  340. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js +40 -0
  341. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.js.map +1 -0
  342. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs +39 -0
  343. package/dist/node/lib/A-ServerRouter/A-ServerRouter.meta.mjs.map +1 -0
  344. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.mts +24 -0
  345. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.d.ts +24 -0
  346. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js +4 -0
  347. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.js.map +1 -0
  348. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs +3 -0
  349. package/dist/node/lib/A-ServerRouter/A-ServerRouter.types.mjs.map +1 -0
  350. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.mts +16 -0
  351. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.d.ts +16 -0
  352. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js +25 -0
  353. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.js.map +1 -0
  354. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs +24 -0
  355. package/dist/node/lib/A-ServerRouter/A-ServerRouterDefine.decorator.mjs.map +1 -0
  356. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.mts +65 -0
  357. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.d.ts +65 -0
  358. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js +260 -0
  359. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.js.map +1 -0
  360. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs +248 -0
  361. package/dist/node/lib/A-ServerStatic/A-ServerStatic.component.mjs.map +1 -0
  362. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.mts +110 -0
  363. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.d.ts +110 -0
  364. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js +180 -0
  365. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.js.map +1 -0
  366. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs +179 -0
  367. package/dist/node/lib/A-ServerStatic/A-ServerStatic.context.mjs.map +1 -0
  368. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.mts +8 -0
  369. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.d.ts +8 -0
  370. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js +4 -0
  371. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.js.map +1 -0
  372. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs +3 -0
  373. package/dist/node/lib/A-ServerStatic/A-ServerStatic.types.mjs.map +1 -0
  374. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.mts +29 -0
  375. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.d.ts +29 -0
  376. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js +62 -0
  377. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.js.map +1 -0
  378. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs +50 -0
  379. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.component.mjs.map +1 -0
  380. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.mts +5 -0
  381. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.d.ts +5 -0
  382. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js +14 -0
  383. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.js.map +1 -0
  384. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs +14 -0
  385. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.constants.mjs.map +1 -0
  386. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.mts +9 -0
  387. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.d.ts +9 -0
  388. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js +4 -0
  389. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.js.map +1 -0
  390. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs +3 -0
  391. package/dist/node/middlewares/A-ServerCORS/A_ServerCORS.types.mjs.map +1 -0
  392. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.mts +24 -0
  393. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.d.ts +24 -0
  394. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js +94 -0
  395. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.js.map +1 -0
  396. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs +82 -0
  397. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.component.mjs.map +1 -0
  398. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.mts +2 -0
  399. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.d.ts +2 -0
  400. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js +4 -0
  401. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.js.map +1 -0
  402. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs +3 -0
  403. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.error.mjs.map +1 -0
  404. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.mts +2 -0
  405. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.d.ts +2 -0
  406. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js +4 -0
  407. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.js.map +1 -0
  408. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs +3 -0
  409. package/dist/node/repositories/A-EntityRepository/A-EntityRepository.types.mjs.map +1 -0
  410. package/examples/simple-server/commands/SignIn.command.ts +17 -1
  411. package/examples/simple-server/components/Test.controller.ts +8 -7
  412. package/examples/simple-server/components/Users.repository.ts +28 -26
  413. package/examples/simple-server/concept.ts +56 -66
  414. package/examples/simple-server/entities/User/User.entity.ts +17 -7
  415. package/jest.config.ts +24 -10
  416. package/package.json +267 -25
  417. package/src/channels/A-Http/A-Http.channel.constants.ts +6 -7
  418. package/src/channels/A-Http/A-Http.channel.error.ts +2 -2
  419. package/src/channels/A-Http/A-Http.channel.ts +76 -125
  420. package/src/channels/A-Http/A-Http.channel.types.ts +6 -3
  421. package/src/channels/A-Websockets/A-Websockets.channel.ts +1 -1
  422. package/src/{components → controllers}/A-CommandController/A-CommandController.component.ts +16 -10
  423. package/src/{components → controllers}/A-EntityController/A-EntityController.component.ts +24 -28
  424. package/src/{components → controllers}/A-ListingController/A-ListingController.component.ts +10 -12
  425. package/src/{components → controllers}/A-ServerHealthMonitor/A-ServerHealthMonitor.component.ts +11 -11
  426. package/src/index.ts +58 -63
  427. package/src/lib/A-Request/A-HttpRequestData.context.ts +30 -0
  428. package/src/lib/A-Request/A-HttpServerRequest.context.ts +103 -0
  429. package/src/lib/A-Request/A-Request.constants.ts +30 -0
  430. package/src/lib/A-Request/A-Request.entity.ts +844 -0
  431. package/src/lib/A-Request/A-Request.env.ts +50 -0
  432. package/src/lib/A-Request/A-Request.error.ts +11 -0
  433. package/src/lib/A-Request/A-Request.helper.ts +276 -0
  434. package/src/lib/A-Request/A-Request.types.ts +284 -0
  435. package/src/lib/A-Request/README.md +567 -0
  436. package/src/lib/A-Response/A-Response.constants.ts +24 -0
  437. package/src/lib/A-Response/A-Response.entity.ts +751 -0
  438. package/src/lib/A-Response/A-Response.error.ts +6 -0
  439. package/src/lib/A-Response/A-Response.types.ts +127 -0
  440. package/src/lib/A-Response/README.md +793 -0
  441. package/src/lib/A-Server/A-HttpServer.constants.ts +9 -0
  442. package/src/lib/A-Server/A-HttpServer.container.ts +256 -0
  443. package/src/lib/A-Server/A-HttpServer.error.ts +165 -0
  444. package/src/lib/A-Server/A-HttpServer.types.ts +37 -0
  445. package/src/{context/A-Server/A_Server.context.ts → lib/A-Server/A-Server.context.ts} +6 -7
  446. package/src/lib/A-Server/A-Server.error.ts +26 -0
  447. package/src/{components/A-ServerError/A-ServerError.types.ts → lib/A-Server/A-Server.types.ts} +8 -0
  448. package/src/{components/A-Controller/A-Controller.component.ts → lib/A-ServerController/A-ServerController.component.ts} +5 -5
  449. package/src/{entities/A_EntityList/A_EntityList.entity.ts → lib/A-ServerEntityList/A-EntityList.entity.ts} +2 -2
  450. package/src/{entities/A_EntityList/A_EntityList.entity.types.ts → lib/A-ServerEntityList/A-EntityList.types.ts} +2 -2
  451. package/src/{context/A-ListQueryFilter/A_ListQueryFilter.context.ts → lib/A-ServerListQuery/A-ServerListQueryFilter.context.ts} +1 -1
  452. package/src/lib/A-ServerLogger/A-ServerLogger.component.ts +121 -0
  453. package/src/lib/A-ServerLogger/A-ServerLogger.types.ts +13 -0
  454. package/src/lib/A-ServerMiddleware/A-ServerMiddleware.component.ts +17 -0
  455. package/src/{components → lib}/A-ServerProxy/A-ServerProxy.component.ts +17 -12
  456. package/src/{context/A-ProxyConfig/A_ProxyConfig.constants.ts → lib/A-ServerProxy/A-ServerProxy.constants.ts} +1 -1
  457. package/src/{context/A-ProxyConfig/A_ProxyConfig.context.ts → lib/A-ServerProxy/A-ServerProxy.context.ts} +4 -4
  458. package/src/{context/A-ProxyConfig/A_ProxyConfig.types.ts → lib/A-ServerProxy/A-ServerProxy.types.ts} +4 -4
  459. package/src/lib/A-ServerRoute/A-ServerRoute.constants.ts +20 -0
  460. package/src/lib/A-ServerRoute/A-ServerRoute.entity.ts +48 -0
  461. package/src/lib/A-ServerRoute/A-ServerRoute.types.ts +6 -0
  462. package/src/{components/A-Router/A-Router.component.ts → lib/A-ServerRouter/A-ServerRouter.component.ts} +77 -97
  463. package/src/lib/A-ServerRouter/A-ServerRouter.constants.ts +8 -0
  464. package/src/lib/A-ServerRouter/A-ServerRouter.meta.ts +48 -0
  465. package/src/lib/A-ServerRouter/A-ServerRouter.types.ts +27 -0
  466. package/src/lib/A-ServerRouter/A-ServerRouterDefine.decorator.ts +37 -0
  467. package/src/{components/A-StaticLoader/A-StaticLoader.component.ts → lib/A-ServerStatic/A-ServerStatic.component.ts} +73 -54
  468. package/src/{context/A-StaticConfig/A-StaticConfig.context.ts → lib/A-ServerStatic/A-ServerStatic.context.ts} +16 -6
  469. package/src/{components → middlewares}/A-ServerCORS/A_ServerCORS.component.ts +16 -13
  470. package/src/{components/A-ServerCORS/A_ServerCORS.component.defaults.ts → middlewares/A-ServerCORS/A_ServerCORS.constants.ts} +2 -2
  471. package/src/{components → repositories}/A-EntityRepository/A-EntityRepository.component.ts +39 -30
  472. package/tests/A-HttpChannel.test.ts +41 -48
  473. package/tests/A-HttpServerError.test.ts +204 -0
  474. package/tests/A-Request.test.ts +351 -0
  475. package/tsconfig.json +40 -50
  476. package/tsup.config.ts +111 -13
  477. package/dist/index.d.mts +0 -855
  478. package/dist/index.d.ts +0 -855
  479. package/dist/index.js +0 -2179
  480. package/dist/index.js.map +0 -1
  481. package/dist/index.mjs +0 -2144
  482. package/dist/index.mjs.map +0 -1
  483. package/examples/microservices-server/components/controllers/Statistics.controller.ts +0 -18
  484. package/examples/microservices-server/components/repositories/Memory.repository.ts +0 -66
  485. package/examples/microservices-server/concept.ts +0 -43
  486. package/examples/microservices-server/context/MemoryStore.context.ts +0 -31
  487. package/examples/microservices-server/entities/Order.entity.ts +0 -7
  488. package/examples/microservices-server/entities/User.entity.ts +0 -8
  489. package/src/components/A-Router/A-Router.component.types.ts +0 -38
  490. package/src/components/A-ServerError/A-ServerError.class.ts +0 -98
  491. package/src/components/A-ServerLogger/A_ServerLogger.component.ts +0 -194
  492. package/src/components/A-ServerLogger/A_ServerLogger.component.types.ts +0 -14
  493. package/src/containers/A-Service/A-Service.container.ts +0 -218
  494. package/src/containers/A-Service/A-Service.container.types.ts +0 -46
  495. package/src/context/A-EntityFactory/A-EntityFactory.context.ts +0 -163
  496. package/src/context/A-EntityFactory/A-EntityFactory.context.types.ts +0 -11
  497. package/src/context/A-HttpChannel/A-HttpChannel.context.ts +0 -36
  498. package/src/context/A-Server/A_Server.context.types.ts +0 -9
  499. package/src/entities/A-Request/A-Request.entity.ts +0 -163
  500. package/src/entities/A-Request/A-Request.entity.types.ts +0 -41
  501. package/src/entities/A-Response/A-Response.entity.ts +0 -194
  502. package/src/entities/A-Response/A-Response.entity.types.ts +0 -26
  503. package/src/entities/A-Route/A-Route.entity.ts +0 -117
  504. package/tests/A-Service.test.ts +0 -18
  505. /package/src/{components → controllers}/A-EntityController/A-EntityController.component.types.ts +0 -0
  506. /package/src/{components/A-Controller/A-Controller.component.types.ts → controllers/A-ListingController/A-ListingController.types.ts} +0 -0
  507. /package/src/{components/A-ServerHealthMonitor/A-ServerHealthMonitor.component.types.ts → controllers/A-ServerHealthMonitor/A-ServerHealthMonitor.types.ts} +0 -0
  508. /package/src/{components/A-EntityRepository/A-EntityRepository.error.ts → lib/A-Response/A-Response.env.ts} +0 -0
  509. /package/src/{components/A-EntityRepository/A-EntityRepository.types.ts → lib/A-ServerController/A-ServerController.types.ts} +0 -0
  510. /package/src/{components → lib}/A-ServerLogger/A-ServerLogger.constants.ts +0 -0
  511. /package/src/{components/A-ListingController/A-ListingController.component.types.ts → lib/A-ServerMiddleware/A-ServerMiddleware.constants.ts} +0 -0
  512. /package/src/{components/A-ServerError/A-ServerError.constants.ts → lib/A-ServerMiddleware/A-ServerMiddleware.types.ts} +0 -0
  513. /package/src/{components/A-StaticLoader/A-StaticLoader.component.types.ts → lib/A-ServerStatic/A-ServerStatic.types.ts} +0 -0
  514. /package/src/{components/A-ServerCORS/A_ServerCORS.component.types.ts → middlewares/A-ServerCORS/A_ServerCORS.types.ts} +0 -0
  515. /package/src/{context/A-StaticConfig/A-StaticConfig.context.types.ts → repositories/A-EntityRepository/A-EntityRepository.error.ts} +0 -0
  516. /package/src/{entities/A-Route/A-Route.entity.types.ts → repositories/A-EntityRepository/A-EntityRepository.types.ts} +0 -0
@@ -0,0 +1,1699 @@
1
+ import { A_ExecutionContext } from '@adaas/a-utils/a-execution';
2
+ import { IncomingMessage, ServerResponse, IncomingHttpHeaders, Server } from 'http';
3
+ import { A_OperationContext, A_Operation_Storage } from '@adaas/a-utils/a-operation';
4
+ import * as _adaas_a_concept from '@adaas/a-concept';
5
+ import { A_TYPES__Error_Init, A_TYPES__Error_Serialized, A_TYPES__Entity_Serialized, A_Error, A_Entity, A_Fragment, A_TYPES__Required, A_Component, A_Scope, A_TYPES__Entity_Constructor, A_TYPES__ConceptENVVariables, A_Feature, A_TYPES__ComponentMeta, A_ComponentMeta, A_TYPES__MetaLinkedComponentConstructors } from '@adaas/a-concept';
6
+ import { A_Config } from '@adaas/a-utils/a-config';
7
+ import { A_Route } from '@adaas/a-utils/a-route';
8
+ import { Readable } from 'stream';
9
+ import { A_Logger } from '@adaas/a-utils/a-logger';
10
+ import { A_Service, A_ServiceFeatures } from '@adaas/a-utils/a-service';
11
+ import { A_Polyfill } from '@adaas/a-utils/a-polyfill';
12
+
13
+ declare class A_HttpRequestData extends A_ExecutionContext<{
14
+ data: Buffer;
15
+ }> {
16
+ constructor(data: Buffer);
17
+ get length(): number;
18
+ get data(): Buffer;
19
+ toString(encoding?: BufferEncoding): string;
20
+ }
21
+
22
+ declare class A_HttpServerRequestContext<_DataType extends any = any> extends A_OperationContext<'http-server-request', {
23
+ request: IncomingMessage;
24
+ response: ServerResponse;
25
+ }, {
26
+ buffers: Buffer[];
27
+ data: _DataType;
28
+ files: Record<string, any[]>;
29
+ }, {
30
+ buffers: Buffer[];
31
+ data: _DataType;
32
+ files: Record<string, any[]>;
33
+ params: {
34
+ request: IncomingMessage;
35
+ response: ServerResponse;
36
+ };
37
+ } & A_Operation_Storage> {
38
+ protected _id: string;
39
+ protected _startTime: [number, number];
40
+ protected _endTime?: [number, number];
41
+ protected _ready?: Promise<void>;
42
+ protected get _request(): IncomingMessage;
43
+ protected get _response(): ServerResponse;
44
+ protected _customResponse: any;
45
+ constructor(request: IncomingMessage, response: ServerResponse);
46
+ get id(): string;
47
+ get buffers(): Buffer[];
48
+ get contentType(): string | undefined;
49
+ get data(): _DataType;
50
+ set data(value: _DataType);
51
+ get length(): number;
52
+ get processingTime(): number;
53
+ startProcessing(): void;
54
+ stopProcessing(): void;
55
+ }
56
+
57
+ declare const A_RequestFeatures: {
58
+ readonly onError: "A_Request_onError";
59
+ readonly onInit: "A_Request_onInit";
60
+ readonly onAfterInit: "A_Request_onAfterInit";
61
+ readonly onParse: "A_Request_onParse";
62
+ readonly onValidate: "A_Request_onValidate";
63
+ readonly onClose: "A_Request_onClose";
64
+ readonly onAborted: "A_Request_onAborted";
65
+ readonly onTimeout: "A_Request_onTimeout";
66
+ readonly onData: "A_Request_onData";
67
+ readonly onEnd: "A_Request_onEnd";
68
+ readonly onBodyParse: "A_Request_onBodyParse";
69
+ readonly onQueryParse: "A_Request_onQueryParse";
70
+ readonly onParamsParse: "A_Request_onParamsParse";
71
+ readonly onCookiesParse: "A_Request_onCookiesParse";
72
+ };
73
+
74
+ declare const A_HttpServerFeatures: {
75
+ readonly onBeforeRequest: "_A_HTTPServer_onBeforeRequest";
76
+ readonly onRequest: "_A_HTTPServer_onRequest";
77
+ readonly onAfterRequest: "_A_HTTPServer_onAfterRequest";
78
+ };
79
+
80
+ type A_HttpServerRequestMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE' | 'DEFAULT';
81
+ type A_HttpServerFeatureNames = typeof A_HttpServerFeatures[keyof typeof A_HttpServerFeatures];
82
+ type A_HttpServerError_Init = {
83
+ /**
84
+ * HTTP Status Code of the error
85
+ */
86
+ status?: number;
87
+ } & A_TYPES__Error_Init;
88
+ type A_HttpServerError_Serialized = {
89
+ /**
90
+ * HTTP Status Code of the error
91
+ */
92
+ status: number;
93
+ } & A_TYPES__Error_Serialized;
94
+
95
+ /**
96
+ * Constructor parameters for A_Request entity
97
+ */
98
+ type A_Request_Init = {
99
+ /**
100
+ * Unique identifier for the request (should correspond to Response id)
101
+ */
102
+ id: string;
103
+ /**
104
+ * ASEID Shard for the request.
105
+ * it's some sort of request fingerprint
106
+ */
107
+ shard: string;
108
+ /**
109
+ * Node.js IncomingMessage object
110
+ */
111
+ request: IncomingMessage;
112
+ /**
113
+ * Request scope for context resolution
114
+ */
115
+ scope: string;
116
+ };
117
+ /**
118
+ * Serialized representation of A_Request entity
119
+ */
120
+ type A_Request_Serialized<_ReqBodyType = any, _ParamsType extends Record<string, string> = any, _QueryType = any> = A_TYPES__Entity_Serialized & {
121
+ method: A_HttpServerRequestMethod;
122
+ url: string;
123
+ headers: Record<string, string | string[] | undefined>;
124
+ params?: _ParamsType;
125
+ query?: _QueryType;
126
+ cookies: Record<string, string>;
127
+ body?: _ReqBodyType;
128
+ userAgent?: string;
129
+ isValid: boolean;
130
+ bodyType?: A_Request_BodyType;
131
+ filesCount?: number;
132
+ fileFieldNames?: string[];
133
+ totalFileSize?: number;
134
+ };
135
+ /**
136
+ * Supported HTTP request methods
137
+ */
138
+ type A_Request_Methods = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD' | 'CONNECT' | 'TRACE' | 'DEFAULT';
139
+ /**
140
+ * Request lifecycle events
141
+ */
142
+ declare enum A_Request_Event {
143
+ Error = "error",
144
+ Finish = "finish",
145
+ Data = "data",
146
+ End = "end",
147
+ Close = "close"
148
+ }
149
+ type A_RequestFeatureNames = typeof A_RequestFeatures[keyof typeof A_RequestFeatures];
150
+ /**
151
+ * Request event callback function type
152
+ */
153
+ type A_Request_EventCallback = (request: A_Request) => void;
154
+ /**
155
+ * Supported body content types for parsing
156
+ */
157
+ type A_Request_BodyType = 'json' | 'form' | 'multipart' | 'raw' | 'text';
158
+ /**
159
+ * Result of body parsing operation
160
+ */
161
+ type A_Request_ParsedBody = {
162
+ /**
163
+ * Type of parsed content
164
+ */
165
+ type: A_Request_BodyType;
166
+ /**
167
+ * Parsed data
168
+ */
169
+ data: any;
170
+ /**
171
+ * Size of the body in bytes
172
+ */
173
+ size: number;
174
+ /**
175
+ * Character encoding used
176
+ */
177
+ encoding?: string;
178
+ /**
179
+ * Multipart boundary (for multipart content)
180
+ */
181
+ boundary?: string;
182
+ };
183
+ /**
184
+ * Session data structure for user session management
185
+ */
186
+ type A_Request_SessionData = {
187
+ /**
188
+ * Unique session identifier
189
+ */
190
+ id?: string;
191
+ /**
192
+ * Associated user ID
193
+ */
194
+ userId?: string;
195
+ /**
196
+ * Session creation timestamp
197
+ */
198
+ createdAt?: Date;
199
+ /**
200
+ * Last access timestamp
201
+ */
202
+ lastAccess?: Date;
203
+ /**
204
+ * Session data storage
205
+ */
206
+ data?: Record<string, any>;
207
+ /**
208
+ * Whether session is expired
209
+ */
210
+ isExpired?: boolean;
211
+ /**
212
+ * Maximum session age in milliseconds
213
+ */
214
+ maxAge?: number;
215
+ };
216
+ /**
217
+ * File upload information for multipart requests
218
+ */
219
+ type A_Request_FileUpload = {
220
+ /**
221
+ * Form field name
222
+ */
223
+ fieldName: string;
224
+ /**
225
+ * Original filename
226
+ */
227
+ filename: string;
228
+ /**
229
+ * File encoding
230
+ */
231
+ encoding: string;
232
+ /**
233
+ * MIME type
234
+ */
235
+ mimetype: string;
236
+ /**
237
+ * File size in bytes
238
+ */
239
+ size: number;
240
+ /**
241
+ * File buffer data
242
+ */
243
+ buffer: Buffer;
244
+ /**
245
+ * Path if saved to disk
246
+ */
247
+ path?: string;
248
+ /**
249
+ * File hash for integrity verification
250
+ */
251
+ hash?: string;
252
+ };
253
+ /**
254
+ * Request validation result with detailed feedback
255
+ */
256
+ type A_Request_ValidationResult = {
257
+ /**
258
+ * Whether validation passed
259
+ */
260
+ isValid: boolean;
261
+ /**
262
+ * Validation error messages
263
+ */
264
+ errors: string[];
265
+ /**
266
+ * Warning messages
267
+ */
268
+ warnings: string[];
269
+ /**
270
+ * Sanitized data after validation
271
+ */
272
+ sanitized?: any;
273
+ };
274
+ /**
275
+ * Request processing configuration options
276
+ */
277
+ type A_Request_Options = {
278
+ /**
279
+ * Maximum request body size in bytes (default: 10MB)
280
+ */
281
+ maxBodySize?: number;
282
+ /**
283
+ * Request timeout in milliseconds (default: 30s)
284
+ */
285
+ timeout?: number;
286
+ /**
287
+ * Default character encoding (default: 'utf8')
288
+ */
289
+ encoding?: string;
290
+ /**
291
+ * Automatically parse cookies (default: true)
292
+ */
293
+ parseCookies?: boolean;
294
+ /**
295
+ * Automatically parse query parameters (default: true)
296
+ */
297
+ parseQuery?: boolean;
298
+ /**
299
+ * Automatically parse request body (default: true)
300
+ */
301
+ parseBody?: boolean;
302
+ /**
303
+ * Enable file upload handling (default: false)
304
+ */
305
+ enableFileUploads?: boolean;
306
+ /**
307
+ * Enable strict validation mode (default: false)
308
+ */
309
+ strictValidation?: boolean;
310
+ };
311
+ /**
312
+ * Request Event Listener Function
313
+ */
314
+ type A_Request_Listener = (req?: A_Request) => void;
315
+
316
+ declare class A_HttpServerError extends A_Error<A_HttpServerError_Init, A_HttpServerError_Serialized> {
317
+ static readonly NotFoundErrorStatus: number;
318
+ static readonly NotFoundError = "Resource Not Found";
319
+ static readonly InternalServerErrorStatus: number;
320
+ static readonly InternalServerError = "Internal Server Error";
321
+ /**
322
+ * HTTP status code to title mapping
323
+ */
324
+ private static readonly HTTP_STATUS_TITLES;
325
+ status: number;
326
+ /**
327
+ * Gets the appropriate title for a given HTTP status code
328
+ */
329
+ private static getHttpStatusTitle;
330
+ constructor(
331
+ /**
332
+ * A_Error Constructor params with required title
333
+ */
334
+ params: A_HttpServerError_Init);
335
+ constructor(
336
+ /**
337
+ * Simplified params with optional title - will auto-generate from status
338
+ */
339
+ params: {
340
+ status?: number;
341
+ description?: string;
342
+ code?: string;
343
+ scope?: string;
344
+ link?: string;
345
+ originalError?: Error | unknown;
346
+ });
347
+ constructor(
348
+ /**
349
+ * HTTP Status Code of the error
350
+ */
351
+ status: number,
352
+ /**
353
+ * Error description
354
+ */
355
+ description: string);
356
+ constructor(
357
+ /**
358
+ * Original JS Error
359
+ */
360
+ error: Error);
361
+ protected fromConstructor(params: A_HttpServerError_Init): void;
362
+ toJSON(): A_HttpServerError_Serialized;
363
+ }
364
+
365
+ declare const A_RequestEnvVariables: {
366
+ /**
367
+ * Default request timeout in milliseconds
368
+ */
369
+ readonly A_SERVER_REQUEST_TIMEOUT: 5000;
370
+ /**
371
+ * Maximum request body size in bytes
372
+ */
373
+ readonly A_SERVER_REQUEST_MAX_BODY_SIZE: number;
374
+ /**
375
+ * Default request encoding
376
+ */
377
+ readonly A_SERVER_REQUEST_DEFAULT_ENCODING: "utf8";
378
+ /**
379
+ * Enable automatic cookie parsing
380
+ */
381
+ readonly A_SERVER_REQUEST_PARSE_COOKIES: true;
382
+ /**
383
+ * Enable automatic query parameter parsing
384
+ */
385
+ readonly A_SERVER_REQUEST_PARSE_QUERY: true;
386
+ /**
387
+ * Enable automatic body parsing
388
+ */
389
+ readonly A_SERVER_REQUEST_PARSE_BODY: true;
390
+ /**
391
+ * Enable file upload handling
392
+ */
393
+ readonly A_SERVER_REQUEST_ENABLE_FILE_UPLOADS: false;
394
+ };
395
+ declare const A_RequestEnvVariablesArray: Array<keyof typeof A_RequestEnvVariables>;
396
+ /**
397
+ * Array of all possible fields in A_RequestEnvVariables
398
+ */
399
+ type A_RequestEnvVariablesType = Array<keyof typeof A_RequestEnvVariables>;
400
+
401
+ declare const A_ServerRouteHttpMethods: {
402
+ readonly DEFAULT: "DEFAULT";
403
+ readonly GET: "GET";
404
+ readonly POST: "POST";
405
+ readonly PUT: "PUT";
406
+ readonly DELETE: "DELETE";
407
+ readonly PATCH: "PATCH";
408
+ readonly OPTIONS: "OPTIONS";
409
+ readonly HEAD: "HEAD";
410
+ readonly CONNECT: "CONNECT";
411
+ readonly TRACE: "TRACE";
412
+ };
413
+ declare const A_ServerRouteProtocols: {
414
+ readonly HTTP: "http";
415
+ readonly HTTPS: "https";
416
+ readonly WS: "ws";
417
+ readonly WSS: "wss";
418
+ };
419
+
420
+ type A_serverRouteProtocolNames = typeof A_ServerRouteProtocols[keyof typeof A_ServerRouteProtocols];
421
+ type A_ServerRouteHttpMethodNames = typeof A_ServerRouteHttpMethods[keyof typeof A_ServerRouteHttpMethods];
422
+
423
+ declare class A_ServerRoute extends A_Route {
424
+ url: string;
425
+ method: A_ServerRouteHttpMethodNames;
426
+ constructor(url: string | RegExp, method: A_ServerRouteHttpMethodNames);
427
+ constructor(url: string | RegExp);
428
+ toString(): string;
429
+ toRegExp(): RegExp;
430
+ toAFeatureExtension(extensionScope?: Array<string>): RegExp;
431
+ }
432
+
433
+ declare class A_Request<_ReqBodyType = any, _ParamsType extends Record<string, string> = any, _QueryType = any> extends A_Entity<A_Request_Init, A_Request_Serialized<_ReqBodyType, _ParamsType, _QueryType>> {
434
+ static get concept(): string;
435
+ /**
436
+ * Request processing status
437
+ */
438
+ protected _listeners: Map<A_RequestFeatureNames, Set<A_Request_Listener>>;
439
+ /**
440
+ * Parsed cookies from request headers
441
+ */
442
+ private _cookies;
443
+ /**
444
+ * Request body type
445
+ */
446
+ private _bodyType?;
447
+ /**
448
+ * Request body data
449
+ */
450
+ private _body;
451
+ private _req;
452
+ private _timeout;
453
+ /**
454
+ * Uploaded files from multipart requests
455
+ */
456
+ private _files;
457
+ /**
458
+ * User agent string from request headers
459
+ */
460
+ private _userAgent?;
461
+ /**
462
+ * Content length in bytes
463
+ */
464
+ private _contentLength?;
465
+ /**
466
+ * Request processing configuration options
467
+ */
468
+ private _options;
469
+ private _routeDefinition?;
470
+ /**
471
+ * A_Request - Comprehensive HTTP Request Processing Entity
472
+ *
473
+ * This class provides a complete wrapper around Node.js IncomingMessage with advanced features:
474
+ * - Automatic body parsing (JSON, form-data, multipart, raw)
475
+ * - Cookie and session management
476
+ * - File upload handling with easy access methods
477
+ * - Request validation
478
+ * - Middleware support
479
+ * - Type-safe parameter extraction
480
+ * - Request timing and metrics
481
+ *
482
+ * @example
483
+ * ```typescript
484
+ * const request = new A_Request({
485
+ * id: 'req-123',
486
+ * request: incomingMessage,
487
+ * scope: 'api'
488
+ * }, {
489
+ * enableFileUploads: true,
490
+ * maxBodySize: 50 * 1024 * 1024 // 50MB for file uploads
491
+ * });
492
+ *
493
+ * await request.init();
494
+ *
495
+ * // Access parsed body
496
+ * const userData = request.body;
497
+ *
498
+ * // Get typed parameters
499
+ * const userId = request.params.id;
500
+ *
501
+ * // Handle file uploads
502
+ * if (request.hasFiles()) {
503
+ * const avatar = request.getFile('avatar');
504
+ * if (avatar) {
505
+ * console.log(`Uploaded file: ${avatar.filename}`);
506
+ * console.log(`File size: ${avatar.size} bytes`);
507
+ * console.log(`File type: ${avatar.mimetype}`);
508
+ *
509
+ * // Access file buffer for processing
510
+ * const fileBuffer = avatar.buffer;
511
+ * // Save to disk, process, etc.
512
+ * }
513
+ *
514
+ * // Get all files for a specific field
515
+ * const documents = request.getFiles('documents');
516
+ * for (const doc of documents) {
517
+ * // Process each document...
518
+ * }
519
+ * }
520
+ *
521
+ * // Check specific files
522
+ * if (request.hasFile('profilePicture')) {
523
+ * const pic = request.getFile('profilePicture');
524
+ * // Process profile picture...
525
+ * }
526
+ * ```
527
+ */
528
+ constructor(params: A_Request_Init, options?: A_Request_Options);
529
+ /**
530
+ * Creates A_Request entity from initialization data
531
+ *
532
+ * @param newEntity
533
+ */
534
+ fromNew(newEntity: A_Request_Init): void;
535
+ /**
536
+ * Core HTTP request object from Node.js
537
+ */
538
+ get original(): IncomingMessage;
539
+ /**
540
+ * Parsed request body data
541
+ */
542
+ get body(): _ReqBodyType;
543
+ /**
544
+ * URL route parameters (e.g., /users/:id)
545
+ */
546
+ get params(): _ParamsType;
547
+ /**
548
+ * Query string parameters
549
+ */
550
+ get query(): _QueryType;
551
+ /**
552
+ * Gets the parsed cookies
553
+ */
554
+ get cookies(): Record<string, string>;
555
+ /**
556
+ * Gets the request URL
557
+ */
558
+ get url(): string;
559
+ /**
560
+ * Gets the HTTP method
561
+ */
562
+ get method(): A_HttpServerRequestMethod;
563
+ /**
564
+ * Gets the request headers
565
+ */
566
+ get headers(): IncomingHttpHeaders;
567
+ /**
568
+ * Gets the timestamp when the request was started
569
+ */
570
+ get startedAt(): Date | undefined;
571
+ /**
572
+ * Gets uploaded files
573
+ */
574
+ get files(): A_Request_FileUpload[];
575
+ /**
576
+ * Gets user agent string
577
+ */
578
+ get userAgent(): string | undefined;
579
+ /**
580
+ * Gets content length
581
+ */
582
+ get contentLength(): number;
583
+ /**
584
+ * Check if request is secure (HTTPS)
585
+ */
586
+ get isSecure(): boolean;
587
+ /**
588
+ * Check if request is from mobile device
589
+ */
590
+ get isMobile(): boolean;
591
+ /**
592
+ * Get request size in bytes
593
+ */
594
+ get size(): number;
595
+ /**
596
+ * Gets content type from headers
597
+ */
598
+ get contentType(): string | undefined;
599
+ /**
600
+ * Pipes request stream to destination
601
+ */
602
+ pipe(destination: NodeJS.WritableStream, options?: {
603
+ end?: boolean | undefined;
604
+ }): NodeJS.WritableStream;
605
+ /**
606
+ * Get a file by field name
607
+ */
608
+ getFile(fieldName: string): A_Request_FileUpload | undefined;
609
+ /**
610
+ * Get all files for a specific field name
611
+ */
612
+ getFiles(fieldName: string): A_Request_FileUpload[];
613
+ /**
614
+ * Check if request has any files
615
+ */
616
+ hasFiles(): boolean;
617
+ /**
618
+ * Check if request has a file with specific field name
619
+ */
620
+ hasFile(fieldName: string): boolean;
621
+ /**
622
+ * Get total size of all uploaded files
623
+ */
624
+ getTotalFileSize(): number;
625
+ /**
626
+ * Get a cookie value
627
+ */
628
+ getCookie(name: string): string | undefined;
629
+ /**
630
+ * Check if request has a specific cookie
631
+ */
632
+ hasCookie(name: string): boolean;
633
+ /**
634
+ * Check if request accepts specific content type
635
+ */
636
+ accepts(contentType: string): boolean;
637
+ /**
638
+ * Get request fingerprint for caching/identification
639
+ */
640
+ getFingerprint(): string;
641
+ /**
642
+ * Registers an event listener for a specific event
643
+ *
644
+ * @param event
645
+ * @param listener
646
+ */
647
+ on(event: A_RequestFeatureNames, listener: A_Request_Listener): void;
648
+ /**
649
+ * Removes an event listener for a specific event
650
+ *
651
+ * @param event
652
+ * @param listener
653
+ */
654
+ off(event: A_RequestFeatureNames, listener: A_Request_Listener): void;
655
+ /**
656
+ * Emits an event to all registered listeners
657
+ *
658
+ * @param event
659
+ */
660
+ emit(event: A_RequestFeatureNames): void;
661
+ /**
662
+ * Allows to use a route definition for this request
663
+ *
664
+ * @param route
665
+ */
666
+ useRoute(route: A_ServerRoute): void;
667
+ clearTimeout(): void;
668
+ /**
669
+ * Initialize the request - parse cookies, query, body etc.
670
+ */
671
+ load(): Promise<void>;
672
+ validate(): Promise<void>;
673
+ /**
674
+ * Destroy the request A-Entity with cleanup
675
+ *
676
+ * @returns
677
+ */
678
+ destroy(): Promise<any>;
679
+ /**
680
+ * Handles request failure - registers error, emits event, and destroys request
681
+ *
682
+ * [!] Destroys the request after handling the failure.
683
+ *
684
+ * @param err
685
+ */
686
+ fail(err?: A_HttpServerError): Promise<void>;
687
+ /**
688
+ * Internal helper method to handle incoming data chunks
689
+ * It creates a new scope for each data chunk, inherits the parent scope,
690
+ * and calls the onData feature with the new scope.
691
+ *
692
+ * [!] This method ensures that each data chunk is processed in isolation,
693
+ * preventing side effects between chunks.
694
+ *
695
+ * @param data
696
+ */
697
+ protected handleData(data: Buffer): Promise<void>;
698
+ /**
699
+ * Handles request close event
700
+ *
701
+ * This method is called when the request is closed prematurely.
702
+ * It triggers the onClose feature and handles any errors that occur during processing.
703
+ *
704
+ */
705
+ protected handleClose(): Promise<void>;
706
+ /**
707
+ * Handles request end event
708
+ *
709
+ * This method is called when the request has finished sending data.
710
+ * It triggers the onEnd feature and handles any errors that occur during processing.
711
+ */
712
+ protected handleEnd(): Promise<void>;
713
+ /**
714
+ * Handles request timeout event
715
+ *
716
+ * This method is called when the request processing exceeds the configured timeout.
717
+ * It triggers the onTimeout feature and fails the request with a timeout error.
718
+ */
719
+ protected handleTimeout(): Promise<void>;
720
+ [A_RequestFeatures.onInit](config: A_Config<['A_SERVER_REQUEST_TIMEOUT']>, context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
721
+ [A_RequestFeatures.onData](context: A_HttpServerRequestContext, chunk: A_HttpRequestData, ...args: any[]): Promise<void>;
722
+ [A_RequestFeatures.onTimeout](context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
723
+ [A_RequestFeatures.onClose](context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
724
+ [A_RequestFeatures.onError](error: A_Error, context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
725
+ [A_RequestFeatures.onEnd](config: A_Config<A_RequestEnvVariablesType>, context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
726
+ [A_RequestFeatures.onValidate](context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
727
+ /**
728
+ * Serialize request for logging/debugging
729
+ */
730
+ toJSON(): A_Request_Serialized;
731
+ }
732
+
733
+ declare class A_RequestError extends A_Error {
734
+ static readonly RequestBodyParsingError = "Unable to parse request body";
735
+ static readonly FileUploadError = "File upload error";
736
+ static readonly RequestTimeoutError = "Request timed out";
737
+ static readonly InvalidRequestError = "Invalid request";
738
+ static readonly MissingParametersError = "Missing required parameters";
739
+ }
740
+
741
+ /**
742
+ * A_RequestHelper - Stateless utility class for HTTP request processing
743
+ *
744
+ * This helper class provides static methods for parsing and processing HTTP request data:
745
+ * - URL parameter extraction from route patterns
746
+ * - Query string parsing
747
+ * - Request body parsing (JSON, form-data, multipart, raw)
748
+ * - URL-encoded form data parsing
749
+ * - Multipart form data parsing (including file uploads)
750
+ *
751
+ * All methods are stateless and only depend on input parameters.
752
+ *
753
+ * @example
754
+ * ```typescript
755
+ * // Extract URL parameters
756
+ * const params = A_RequestHelper.extractParams('/users/123', '/users/:id');
757
+ * // { id: '123' }
758
+ *
759
+ * // Parse query string
760
+ * const query = A_RequestHelper.extractQuery('/api/users?page=1&limit=10');
761
+ * // { page: '1', limit: '10' }
762
+ *
763
+ * // Parse request body
764
+ * const result = await A_RequestHelper.parseRequestBody(req, { maxBodySize: 1024 * 1024 });
765
+ * // { data: {...}, type: 'json' }
766
+ * ```
767
+ */
768
+ declare class A_RequestHelper {
769
+ /**
770
+ * Extract URL parameters from a URL using a route pattern
771
+ * @param url - The actual URL to extract parameters from
772
+ * @param routePattern - The route pattern with parameters (e.g., "/users/:id/posts/:postId")
773
+ * @returns Object containing extracted parameters
774
+ */
775
+ static extractParams(url: string, routePattern: string): Record<string, string>;
776
+ /**
777
+ * Extract query parameters from URL
778
+ * @param url - The URL to extract query parameters from
779
+ * @returns Object containing query parameters
780
+ */
781
+ static extractQuery<T = Record<string, string>>(url: string): T;
782
+ /**
783
+ * Parse cookies from Cookie header
784
+ */
785
+ static parseCookies(cookieHeader?: string): Record<string, string>;
786
+ /**
787
+ * Parse request body based on Content-Type
788
+ *
789
+ *
790
+ * @param context - The HTTP server request context
791
+ * @returns Parsed body data and detected body type
792
+ */
793
+ static parseRequestBody<T extends any = any>(context: A_HttpServerRequestContext): {
794
+ data: T;
795
+ type: A_Request_BodyType;
796
+ };
797
+ /**
798
+ * Parse URL-encoded form data (application/x-www-form-urlencoded)
799
+ * @param body - The URL-encoded body string
800
+ * @returns Object containing form data
801
+ */
802
+ static parseFormUrlEncoded(
803
+ /**
804
+ * The URL-encoded body string
805
+ */
806
+ body: string): Record<string, string | string[]>;
807
+ /**
808
+ * Parse multipart form data (for file uploads and form data)
809
+ * @param buffer - The raw buffer containing multipart data
810
+ * @param contentType - The content type header
811
+ * @returns Object containing fields and files
812
+ */
813
+ static parseMultipartData(
814
+ /**
815
+ * The raw buffer containing multipart data
816
+ */
817
+ buffer: Buffer,
818
+ /**
819
+ * The content type header
820
+ */
821
+ contentType: string): {
822
+ fields: Record<string, string>;
823
+ files: A_Request_FileUpload[];
824
+ };
825
+ }
826
+
827
+ declare const A_ResponseFeatures: {
828
+ /**
829
+ * Event fired when an error occurs while sending the response
830
+ */
831
+ readonly onError: "_A_Response_onError";
832
+ /**
833
+ * Event fired when the response is closed
834
+ */
835
+ readonly onClose: "_A_Response_onClose";
836
+ /**
837
+ * Event fired when the response is finished
838
+ */
839
+ readonly onFinish: "_A_Response_onFinish";
840
+ /**
841
+ * Event fired when the response is sent
842
+ */
843
+ readonly onSend: "_A_Response_onSend";
844
+ /**
845
+ * Event fired when the response is redirected
846
+ */
847
+ readonly onRedirect: "_A_Response_onRedirect";
848
+ };
849
+
850
+ type A_Response_Constructor = {
851
+ /**
852
+ * Should correspond to Request id
853
+ */
854
+ id: string;
855
+ scope: string;
856
+ shard: string;
857
+ response: ServerResponse;
858
+ };
859
+ type A_Response_Serialized<T extends any> = {
860
+ status: number;
861
+ headersSent: boolean;
862
+ size: number;
863
+ data: T;
864
+ redirectURL?: string;
865
+ } & A_TYPES__Entity_Serialized;
866
+ type A_Response_SendResponseObject<_ResponseType = any> = Record<string, _ResponseType>;
867
+ /**
868
+ * Cookie configuration for setting response cookies
869
+ */
870
+ type A_Response_CookieOptions = {
871
+ domain?: string;
872
+ path?: string;
873
+ secure?: boolean;
874
+ httpOnly?: boolean;
875
+ maxAge?: number;
876
+ expires?: Date;
877
+ sameSite?: 'strict' | 'lax' | 'none';
878
+ signed?: boolean;
879
+ };
880
+ type A_ResponseFeatureNames = typeof A_ResponseFeatures[keyof typeof A_ResponseFeatures];
881
+ /**
882
+ * Response streaming options
883
+ */
884
+ type A_Response_StreamOptions = {
885
+ chunkSize?: number;
886
+ delay?: number;
887
+ encoding?: BufferEncoding;
888
+ transform?: (chunk: any) => any;
889
+ onProgress?: (bytesWritten: number, totalBytes: number) => void;
890
+ onComplete?: () => void;
891
+ onError?: (error: Error) => void;
892
+ };
893
+ /**
894
+ * Response compression options
895
+ */
896
+ type A_Response_CompressionOptions = {
897
+ threshold?: number;
898
+ level?: number;
899
+ strategy?: number;
900
+ chunkSize?: number;
901
+ windowBits?: number;
902
+ memLevel?: number;
903
+ };
904
+ /**
905
+ * File download options
906
+ */
907
+ type A_Response_DownloadOptions = {
908
+ filename?: string;
909
+ contentType?: string;
910
+ disposition?: 'attachment' | 'inline';
911
+ maxAge?: number;
912
+ etag?: boolean;
913
+ lastModified?: boolean;
914
+ cacheControl?: string;
915
+ };
916
+ /**
917
+ * Response caching options
918
+ */
919
+ type A_Response_CacheOptions = {
920
+ maxAge?: number;
921
+ sMaxAge?: number;
922
+ noCache?: boolean;
923
+ noStore?: boolean;
924
+ mustRevalidate?: boolean;
925
+ proxyRevalidate?: boolean;
926
+ immutable?: boolean;
927
+ private?: boolean;
928
+ public?: boolean;
929
+ etag?: string;
930
+ lastModified?: Date;
931
+ };
932
+ /**
933
+ * Response configuration options
934
+ */
935
+ type A_Response_Options = {
936
+ autoCompress?: boolean;
937
+ compressionThreshold?: number;
938
+ enableCaching?: boolean;
939
+ defaultCacheMaxAge?: number;
940
+ enableMetrics?: boolean;
941
+ enableEtag?: boolean;
942
+ enableLastModified?: boolean;
943
+ charset?: string;
944
+ defaultContentType?: string;
945
+ maxRedirects?: number;
946
+ enableCookies?: boolean;
947
+ enableSessions?: boolean;
948
+ };
949
+ /**
950
+ * Response Event Listener Function
951
+ */
952
+ type A_Response_Listener = (res?: A_Response) => void;
953
+
954
+ /**
955
+ * A_Response - Comprehensive HTTP Response Processing Entity
956
+ *
957
+ * This class provides a complete wrapper around Node.js ServerResponse with advanced features:
958
+ * - Response data accumulation and value management
959
+ * - Error collection and standardized error responses
960
+ * - Response streaming with progress tracking
961
+ * - Template rendering and view engine support
962
+ * - Cookie management and secure cookie handling
963
+ * - Response compression (gzip, deflate, brotli)
964
+ * - File downloads and static file serving
965
+ * - Response caching and ETags
966
+ * - Performance metrics and timing
967
+ * - Response validation and content negotiation
968
+ *
969
+ * @example
970
+ */
971
+ declare class A_Response<_ResponseType = any> extends A_Entity<A_Response_Constructor, A_Response_Serialized<_ResponseType>> {
972
+ static get namespace(): string;
973
+ /**
974
+ * Original ServerResponse object
975
+ */
976
+ private _res;
977
+ /**
978
+ * Internal object to store all response data
979
+ */
980
+ private _data;
981
+ /**
982
+ * uses in case the response isn't an object
983
+ */
984
+ private _dataOverride?;
985
+ /**
986
+ * Redirect URL for handling redirects
987
+ */
988
+ private _redirectURL?;
989
+ /**
990
+ * Cookies map for managing response cookies
991
+ */
992
+ private _cookies;
993
+ /**
994
+ * Indicates if the response has finished
995
+ */
996
+ private _cacheOptions?;
997
+ /**
998
+ * Indicates if the response has finished
999
+ */
1000
+ private _options;
1001
+ /**
1002
+ * Event listeners map for A_Response events
1003
+ */
1004
+ private _listeners;
1005
+ /**
1006
+ * Whether this response is operating as a persistent SSE stream
1007
+ */
1008
+ private _isStreaming;
1009
+ constructor(params: A_Response_Constructor, options?: A_Response_Options);
1010
+ /**
1011
+ * Initialize from new entity parameters
1012
+ */
1013
+ fromNew(newEntity: A_Response_Constructor): void;
1014
+ /**
1015
+ * Gets the response data map
1016
+ */
1017
+ get data(): Map<string, _ResponseType>;
1018
+ /**
1019
+ * Gets the original ServerResponse object
1020
+ */
1021
+ get original(): ServerResponse;
1022
+ /**
1023
+ * Gets whether headers have been sent
1024
+ */
1025
+ get headersSent(): boolean;
1026
+ /**
1027
+ * Gets the current status code
1028
+ */
1029
+ get statusCode(): number;
1030
+ /**
1031
+ * Gets response size in bytes
1032
+ */
1033
+ get size(): number;
1034
+ /**
1035
+ * Whether this response is in SSE streaming mode.
1036
+ * When true the server container will NOT auto-send and destroy() will
1037
+ * leave the underlying socket open.
1038
+ */
1039
+ get isStreaming(): boolean;
1040
+ /**
1041
+ * Initialize the response
1042
+ */
1043
+ load(): Promise<void>;
1044
+ /**
1045
+ * Destroy the response
1046
+ */
1047
+ destroy(): Promise<any>;
1048
+ /**
1049
+ * Handle response failure with error details
1050
+ */
1051
+ fail(err?: A_HttpServerError): Promise<void>;
1052
+ /**
1053
+ * Send a plain text or JSON response
1054
+ */
1055
+ send(data?: any): Promise<void>;
1056
+ /**
1057
+ * Stream response data
1058
+ */
1059
+ stream(dataStream: Readable | any[]): Promise<void>;
1060
+ /**
1061
+ * Redirect response
1062
+ *
1063
+ * [!] Note: This method ends the response immediately.
1064
+ */
1065
+ redirect(url: string): Promise<void>;
1066
+ /**
1067
+ * Upgrade this response to a persistent SSE stream.
1068
+ * Sends the required headers and writes the initial `:ok` comment to flush
1069
+ * the connection. After calling this the response will NOT be auto-closed
1070
+ * by the server container or by destroy().
1071
+ */
1072
+ sseOpen(): void;
1073
+ /**
1074
+ * Write a named SSE event onto the open stream.
1075
+ * Format: `event: <name>\ndata: <JSON>\n\n`
1076
+ *
1077
+ * Compatible with browser EventSource `addEventListener(name, handler)`.
1078
+ *
1079
+ * @returns false when the channel is no longer writable
1080
+ */
1081
+ sseWrite(event: string, data?: any): boolean;
1082
+ /**
1083
+ * Close the SSE stream gracefully.
1084
+ */
1085
+ sseClose(): void;
1086
+ /**
1087
+ * Write head with status and headers
1088
+ */
1089
+ writeHead(statusCode: number, headers?: Record<string, string> | IncomingHttpHeaders | any): this;
1090
+ /**
1091
+ * Set HTTP status code
1092
+ */
1093
+ status(code: number): this;
1094
+ /**
1095
+ * Set response header
1096
+ */
1097
+ setHeader(key: string, value: string | number | string[]): this;
1098
+ /**
1099
+ * Get response header
1100
+ */
1101
+ getHeader(key: string): string | number | string[] | undefined;
1102
+ /**
1103
+ * Remove response header
1104
+ */
1105
+ removeHeader(key: string): this;
1106
+ /**
1107
+ * Set cookie
1108
+ */
1109
+ setCookie(name: string, value: string, options?: A_Response_CookieOptions): this;
1110
+ /**
1111
+ * Clear cookie
1112
+ */
1113
+ clearCookie(name: string, options?: A_Response_CookieOptions): this;
1114
+ /**
1115
+ * Add data to response
1116
+ */
1117
+ add(key: string, data: _ResponseType): this;
1118
+ /**
1119
+ * Remove data from response
1120
+ */
1121
+ remove(key: string): this;
1122
+ /**
1123
+ * Get data from response
1124
+ */
1125
+ get(key: string): _ResponseType | undefined;
1126
+ /**
1127
+ * Check if response has data
1128
+ */
1129
+ has(key: string): boolean;
1130
+ /**
1131
+ * Clear all response data
1132
+ */
1133
+ clear(): this;
1134
+ /**
1135
+ * Handle response finish event
1136
+ *
1137
+ * @returns
1138
+ */
1139
+ protected handleFinish(): Promise<void>;
1140
+ /**
1141
+ * Handle response close event
1142
+ */
1143
+ protected handleClose(): Promise<void>;
1144
+ /**
1145
+ * Registers an event listener for a specific event
1146
+ *
1147
+ * @param event
1148
+ * @param listener
1149
+ */
1150
+ on(event: A_ResponseFeatureNames, listener: A_Response_Listener): void;
1151
+ /**
1152
+ * Removes an event listener for a specific event
1153
+ *
1154
+ * @param event
1155
+ * @param listener
1156
+ */
1157
+ off(event: A_ResponseFeatureNames, listener: A_Response_Listener): void;
1158
+ /**
1159
+ * Emits an event to all registered listeners
1160
+ *
1161
+ * @param event
1162
+ */
1163
+ emit(event: A_ResponseFeatureNames): void;
1164
+ [A_ResponseFeatures.onSend](context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
1165
+ [A_ResponseFeatures.onRedirect](context: A_HttpServerRequestContext, ...args: any[]): Promise<void>;
1166
+ [A_ResponseFeatures.onError](error: A_HttpServerError, context: A_HttpServerRequestContext, request: A_Request, ...args: any[]): Promise<void>;
1167
+ /**
1168
+ * Set standard response headers
1169
+ */
1170
+ protected setDefaultResponseHeaders(): void;
1171
+ /**
1172
+ * Set cookie headers
1173
+ */
1174
+ protected setCookieHeaders(): void;
1175
+ /**
1176
+ * Set cache headers
1177
+ */
1178
+ protected setCacheHeaders(): void;
1179
+ /**
1180
+ * Convert accumulated data to response object
1181
+ */
1182
+ toResponse(): _ResponseType;
1183
+ /**
1184
+ * Enhanced JSON serialization for logging/debugging
1185
+ */
1186
+ toJSON(): A_Response_Serialized<_ResponseType>;
1187
+ }
1188
+
1189
+ declare class A_ResponseError extends A_Error {
1190
+ }
1191
+
1192
+ declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES: {
1193
+ /**
1194
+ * Port for the server to listen on
1195
+ * [!] Default is 3000
1196
+ * @default 3000
1197
+ */
1198
+ readonly A_SERVER_PORT: "A_SERVER_PORT";
1199
+ };
1200
+ type A_TYPES__ServerENVVariables = (typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES)[keyof typeof A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES][];
1201
+ declare const A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY: readonly ["A_SERVER_PORT"];
1202
+
1203
+ type A_SERVER_TYPES__ServerConstructor = {
1204
+ name: string;
1205
+ version: string;
1206
+ routes: A_ServerRoute[];
1207
+ port: number;
1208
+ };
1209
+ type A_SERVER_TYPES__ServerError_Init = {
1210
+ /**
1211
+ * HTTP Status Code of the error
1212
+ */
1213
+ status?: number;
1214
+ } & A_TYPES__Error_Init;
1215
+ type A_SERVER_TYPES__ServerError_Serialized = {
1216
+ /**
1217
+ * HTTP Status Code of the error
1218
+ */
1219
+ status: number;
1220
+ } & A_TYPES__Error_Serialized;
1221
+
1222
+ declare class A_Server extends A_Fragment {
1223
+ port: number;
1224
+ version: string;
1225
+ protected _routes: A_ServerRoute[];
1226
+ constructor(params: A_TYPES__Required<Partial<A_SERVER_TYPES__ServerConstructor>, [
1227
+ 'port',
1228
+ 'name'
1229
+ ]>);
1230
+ /**
1231
+ * A list of routes that the server will listen to
1232
+ */
1233
+ get routes(): A_ServerRoute[];
1234
+ }
1235
+
1236
+ declare class A_ServerLogger extends A_Logger {
1237
+ protected config: A_Config<any>;
1238
+ logRequestFinish(request: A_Request, response: A_Response, context: A_HttpServerRequestContext): void;
1239
+ logResponseError(request: A_Request, response: A_Response, context: A_HttpServerRequestContext, error: A_Error): void;
1240
+ logStop(server: A_Server): void;
1241
+ serverReady(params: {
1242
+ port: number;
1243
+ app: {
1244
+ name: string;
1245
+ version?: string;
1246
+ };
1247
+ }): void;
1248
+ /**
1249
+ * Displays a proxy routes
1250
+ *
1251
+ * @param params
1252
+ */
1253
+ proxy(params: {
1254
+ original: string;
1255
+ destination: string;
1256
+ }): void;
1257
+ }
1258
+
1259
+ /**
1260
+ * A-Service is a container that can run different types of services, such as HTTP servers, workers, etc.
1261
+ * Depending on the provided config and configuration, it will load the necessary components and start the service.
1262
+ *
1263
+ */
1264
+ declare class A_HttpServer extends A_Service {
1265
+ protected server: Server;
1266
+ static get onBeforeRequest(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => any;
1267
+ static get onRequest(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => any;
1268
+ static get onAfterRequest(): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => any;
1269
+ protected [A_ServiceFeatures.onStart](polyfill: A_Polyfill, config: A_Config<A_TYPES__ServerENVVariables>): Promise<void>;
1270
+ protected [A_ServiceFeatures.onAfterStart](config: A_Config<A_TYPES__ServerENVVariables>, logger: A_ServerLogger): Promise<void>;
1271
+ protected [A_ServiceFeatures.onStop](...args: any[]): Promise<void>;
1272
+ close(): Promise<void>;
1273
+ listen(port: number): Promise<void>;
1274
+ protected [A_HttpServerFeatures.onBeforeRequest](...args: any[]): Promise<void>;
1275
+ protected [A_HttpServerFeatures.onRequest](...args: any[]): Promise<void>;
1276
+ protected [A_HttpServerFeatures.onAfterRequest](...args: any[]): Promise<void>;
1277
+ handleRequest(request: IncomingMessage, response: ServerResponse): Promise<void>;
1278
+ }
1279
+
1280
+ declare class A_ServerError extends A_Error<A_SERVER_TYPES__ServerError_Init, A_SERVER_TYPES__ServerError_Serialized> {
1281
+ status: number;
1282
+ protected fromConstructor(params: A_SERVER_TYPES__ServerError_Init): void;
1283
+ toJSON(): A_SERVER_TYPES__ServerError_Serialized;
1284
+ }
1285
+
1286
+ declare class A_ServerController extends A_Component {
1287
+ callEntityMethod(request: A_Request<any, any, {
1288
+ component: string;
1289
+ operation: string;
1290
+ }>, response: A_Response, scope: A_Scope): Promise<void>;
1291
+ }
1292
+
1293
+ type A_SERVER_TYPES__A_EntityListConstructor = {
1294
+ name: string;
1295
+ scope: string;
1296
+ constructor: A_TYPES__Entity_Constructor;
1297
+ };
1298
+ declare enum A_SERVER_TYPES__A_EntityListEvent {
1299
+ Load = "load"
1300
+ }
1301
+ type A_SERVER_TYPES__A_EntityListSerialized<EntityTypes extends A_Entity = A_Entity> = {
1302
+ items: Array<ReturnType<EntityTypes['toJSON']>>;
1303
+ type: string;
1304
+ pagination: A_SERVER_TYPES__A_EntityListPagination;
1305
+ } & A_TYPES__Entity_Serialized;
1306
+ type A_SERVER_TYPES__A_EntityListPagination = {
1307
+ total: number;
1308
+ page: number;
1309
+ pageSize: number;
1310
+ };
1311
+
1312
+ /**
1313
+ * A-EntityList
1314
+ *
1315
+ * Entity that represents a list of entities with pagination of particular type
1316
+ */
1317
+ declare class A_ServerEntityList<EntityType extends A_Entity = A_Entity> extends A_Entity<A_SERVER_TYPES__A_EntityListConstructor, A_SERVER_TYPES__A_EntityListSerialized> {
1318
+ static get scope(): string;
1319
+ protected _entityConstructor: new (...args: ConstructorParameters<typeof A_Entity>) => EntityType;
1320
+ protected _items: Array<EntityType>;
1321
+ protected _pagination: A_SERVER_TYPES__A_EntityListPagination;
1322
+ /**
1323
+ * Returns the entity constructor used for the list
1324
+ */
1325
+ get entityConstructor(): new (...args: ConstructorParameters<typeof A_Entity>) => EntityType;
1326
+ /**
1327
+ * Returns the list of items contained in the entity list
1328
+ */
1329
+ get items(): Array<EntityType>;
1330
+ /**
1331
+ * Returns pagination information about the entity list
1332
+ */
1333
+ get pagination(): A_SERVER_TYPES__A_EntityListPagination;
1334
+ /**
1335
+ * Creates a new instance of A_EntityList
1336
+ *
1337
+ * @param newEntity
1338
+ */
1339
+ fromNew(newEntity: A_SERVER_TYPES__A_EntityListConstructor): void;
1340
+ /**
1341
+ * Allows to convert Repository Response data to EntityList instance
1342
+ *
1343
+ * [!] This method does not load the data from the repository, it only converts the data to the EntityList instance
1344
+ *
1345
+ * @param items
1346
+ * @param pagination
1347
+ */
1348
+ fromList(items: Array<EntityType> | Array<ReturnType<EntityType['toJSON']>>, pagination?: A_SERVER_TYPES__A_EntityListPagination): void;
1349
+ /**
1350
+ * Serializes the EntityList to a JSON object
1351
+ *
1352
+ * @returns
1353
+ */
1354
+ toJSON(): A_SERVER_TYPES__A_EntityListSerialized<EntityType>;
1355
+ }
1356
+
1357
+ declare class A_ServerListQueryFilter<FilterFields extends string[]> extends A_Fragment {
1358
+ protected _query: string | Partial<Record<FilterFields[number], string>>;
1359
+ protected defaults: Partial<Record<FilterFields[number], string>>;
1360
+ protected parsedQuery: Record<FilterFields[number], string>;
1361
+ constructor(_query?: string | Partial<Record<FilterFields[number], string>>, defaults?: Partial<Record<FilterFields[number], string>>);
1362
+ get query(): string | Partial<Record<FilterFields[number], string>>;
1363
+ get(property: FilterFields[number], defaultValue?: string): string;
1364
+ protected parseQueryString(value?: string | Partial<Record<FilterFields[number], string>>): Record<FilterFields[number], string>;
1365
+ }
1366
+
1367
+ declare const A_SERVER__A_SERVER_LOGGER_ENV_VARIABLES: {
1368
+ /**
1369
+ * Enable logging of 200 responses
1370
+ */
1371
+ readonly SERVER_IGNORE_LOG_200: "SERVER_IGNORE_LOG_200";
1372
+ /**
1373
+ * Enable logging of 404 responses
1374
+ */
1375
+ readonly SERVER_IGNORE_LOG_404: "SERVER_IGNORE_LOG_404";
1376
+ /**
1377
+ * Enable logging of 500 responses
1378
+ */
1379
+ readonly SERVER_IGNORE_LOG_500: "SERVER_IGNORE_LOG_500";
1380
+ /**
1381
+ * Enable logging of 400 responses
1382
+ */
1383
+ readonly SERVER_IGNORE_LOG_400: "SERVER_IGNORE_LOG_400";
1384
+ /**
1385
+ * Enable logging of default responses
1386
+ */
1387
+ readonly SERVER_IGNORE_LOG_DEFAULT: "SERVER_IGNORE_LOG_DEFAULT";
1388
+ };
1389
+
1390
+ type A_SERVER_TYPES__ServerLoggerRouteParams = {
1391
+ method: string;
1392
+ url: string;
1393
+ status: number;
1394
+ responseTime: number;
1395
+ };
1396
+ type A_SERVER_TYPES__ServerLoggerEnvVariables = Array<keyof typeof A_SERVER__A_SERVER_LOGGER_ENV_VARIABLES> | A_TYPES__ConceptENVVariables;
1397
+
1398
+ declare class A_ServerMiddleware extends A_Component {
1399
+ }
1400
+
1401
+ type A_SERVER_TYPES__ProxyConfigConstructor = Record<string, string | Partial<A_SERVER_TYPES__ProxyConfigConstructorConfig>>;
1402
+ type A_SERVER_TYPES__ProxyConfigConstructorConfig = {
1403
+ hostname: string;
1404
+ protocol: 'http' | 'https' | string;
1405
+ port: number;
1406
+ path: string;
1407
+ method: A_ServerRouteHttpMethodNames;
1408
+ headers: Record<string, string>;
1409
+ };
1410
+ type A_SERVER_TYPES__RoutesConfig = {
1411
+ route: A_ServerRoute;
1412
+ protocol: 'http' | 'https' | string;
1413
+ hostname: string;
1414
+ port: number;
1415
+ headers: Record<string, string>;
1416
+ };
1417
+
1418
+ declare class A_ProxyConfig extends A_Fragment {
1419
+ protected readonly _configs: Array<A_SERVER_TYPES__RoutesConfig>;
1420
+ constructor(
1421
+ /**
1422
+ * Setup proxy configs, where key is the path to match, and value is either a full URL or a partial config object
1423
+ */
1424
+ configs?: A_SERVER_TYPES__ProxyConfigConstructor);
1425
+ /**
1426
+ * Returns all configured proxy configs
1427
+ *
1428
+ */
1429
+ get configs(): Array<A_SERVER_TYPES__RoutesConfig>;
1430
+ /**
1431
+ * Checks if a given path is configured in the proxy
1432
+ *
1433
+ * @param path
1434
+ * @returns
1435
+ */
1436
+ has(path: string): boolean;
1437
+ /**
1438
+ * Returns the proxy configuration for a given path, if exists
1439
+ *
1440
+ * @param path
1441
+ * @returns
1442
+ */
1443
+ config(path: string): A_SERVER_TYPES__RoutesConfig | undefined;
1444
+ }
1445
+
1446
+ declare class A_ServerProxy extends A_Component {
1447
+ load(logger: A_Logger, config: A_ProxyConfig): Promise<void>;
1448
+ onRequest(req: A_Request, res: A_Response, proxyConfig: A_ProxyConfig, logger: A_Logger, polyfill: A_Polyfill, feature: A_Feature): Promise<void>;
1449
+ }
1450
+
1451
+ declare const PROXY_CONFIG_DEFAULTS: A_SERVER_TYPES__ProxyConfigConstructorConfig;
1452
+
1453
+ declare const A_ServerRouterMetaKeys: {
1454
+ readonly ROUTES: "_A_ServerRouterMeta_ROUTES";
1455
+ readonly ROUTES_CONFIGS: "_A_ServerRouterMeta_ROUTES_CONFIGS";
1456
+ };
1457
+
1458
+ type A_ServerRouterRouteDefinition = {
1459
+ component: A_Component;
1460
+ handler: string;
1461
+ route: A_ServerRoute;
1462
+ };
1463
+ type A_ServerRouterMetaStructure = {
1464
+ [A_ServerRouterMetaKeys.ROUTES]: Map<string, A_ServerRouterRouteDefinition>;
1465
+ [A_ServerRouterMetaKeys.ROUTES_CONFIGS]: Array<A_ServerRoute>;
1466
+ } & A_TYPES__ComponentMeta;
1467
+ type A_ServerRouterMetaKeyNames = typeof A_ServerRouterMetaKeys[keyof typeof A_ServerRouterMetaKeys];
1468
+ type A_ServerRouterRouteConfig = {
1469
+ path: string | RegExp;
1470
+ version: string;
1471
+ prefix: string;
1472
+ };
1473
+
1474
+ declare class A_ServerRouterMeta extends A_ComponentMeta<A_ServerRouterMetaStructure> {
1475
+ get routes(): Array<A_ServerRoute>;
1476
+ get definitions(): Map<string, A_ServerRouterRouteDefinition>;
1477
+ addRoute(regexp: RegExp, route: A_ServerRouterRouteDefinition): void;
1478
+ removeRoute(route: A_ServerRoute): void;
1479
+ }
1480
+
1481
+ declare class A_ServerRouter extends A_Component {
1482
+ /**
1483
+ * Allows to define a custom route for POST requests
1484
+ *
1485
+ * @param path
1486
+ * @returns
1487
+ */
1488
+ static Post(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1489
+ /**
1490
+ * Allows to define a custom route for GET requests
1491
+ *
1492
+ * @param path
1493
+ * @returns
1494
+ */
1495
+ static Get(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1496
+ /**
1497
+ * Allows to define a custom route for PUT requests
1498
+ *
1499
+ * @param path
1500
+ * @returns
1501
+ */
1502
+ static Put(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1503
+ /**
1504
+ * Allows to define a custom route for DELETE requests
1505
+ *
1506
+ * @param path
1507
+ * @returns
1508
+ */
1509
+ static Delete(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1510
+ /**
1511
+ * Allows to define a custom route for PATCH requests
1512
+ *
1513
+ * @param path
1514
+ * @returns
1515
+ */
1516
+ static Patch(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1517
+ /**
1518
+ * Allows to define a custom route for DEFAULT requests
1519
+ *
1520
+ * @param path
1521
+ * @returns
1522
+ */
1523
+ static Default(path: string | A_ServerRoute | RegExp | A_TYPES__Required<Partial<A_ServerRouterRouteConfig>, ['path']>): <TTarget extends _adaas_a_concept.A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1524
+ /**
1525
+ * Private method to have the same signature for all route methods
1526
+ *
1527
+ * @param method
1528
+ * @param path
1529
+ * @returns
1530
+ */
1531
+ private static defineRoute;
1532
+ protected load(logger: A_ServerLogger): Promise<void>;
1533
+ identifyRoute(request: A_Request, response: A_Response, scope: A_Scope, config: A_Config, logger: A_Logger, route: A_ServerRoute): Promise<void>;
1534
+ }
1535
+
1536
+ /**
1537
+ *
1538
+ * This decorator should allow to set a default meta type for the class, this helps to avoid
1539
+ * the need to create custom meta classes for each class.
1540
+ *
1541
+ * @returns
1542
+ */
1543
+ declare function A_ServerRouterDefineDecorator(route: A_ServerRoute): <TTarget extends A_TYPES__MetaLinkedComponentConstructors>(target: A_Component, propertyKey: string, descriptor: PropertyDescriptor) => any;
1544
+
1545
+ interface A_StaticAlias {
1546
+ alias: string;
1547
+ path: string;
1548
+ directory: string;
1549
+ enabled?: boolean;
1550
+ }
1551
+ interface A_StaticDirectoryConfig {
1552
+ path: string;
1553
+ directory: string;
1554
+ alias?: string;
1555
+ }
1556
+ declare class A_StaticConfig extends A_Fragment {
1557
+ readonly directories: Array<string>;
1558
+ private _aliases;
1559
+ private _directoryConfigs;
1560
+ constructor(
1561
+ /**
1562
+ * Setup directories to serve static files from, comma separated
1563
+ */
1564
+ directories?: string[],
1565
+ /**
1566
+ * Custom directory configurations with aliases
1567
+ */
1568
+ directoryConfigs?: A_StaticDirectoryConfig[]);
1569
+ private initializeDefaultAliases;
1570
+ private initializeCustomAliases;
1571
+ /**
1572
+ * Add a custom static file alias
1573
+ * @param alias - The URL path alias (e.g., '/assets')
1574
+ * @param directory - The local directory path
1575
+ * @param path - Optional custom path (defaults to alias)
1576
+ */
1577
+ addAlias(alias: string, directory: string, path?: string): void;
1578
+ /**
1579
+ * Remove a static file alias
1580
+ * @param aliasPath - The path of the alias to remove
1581
+ */
1582
+ removeAlias(aliasPath: string): boolean;
1583
+ /**
1584
+ * Enable or disable an alias
1585
+ * @param aliasPath - The path of the alias
1586
+ * @param enabled - Whether to enable or disable
1587
+ */
1588
+ setAliasEnabled(aliasPath: string, enabled: boolean): boolean;
1589
+ /**
1590
+ * Get all configured aliases
1591
+ */
1592
+ getAliases(): A_StaticAlias[];
1593
+ /**
1594
+ * Get enabled aliases only
1595
+ */
1596
+ getEnabledAliases(): A_StaticAlias[];
1597
+ /**
1598
+ * Find the best matching alias for a given request path
1599
+ * @param requestPath - The request path to match
1600
+ */
1601
+ findMatchingAlias(requestPath: string): A_StaticAlias | null;
1602
+ /**
1603
+ * Check if an alias exists
1604
+ * @param aliasPath - The path to check
1605
+ */
1606
+ hasAlias(aliasPath: string): boolean;
1607
+ /**
1608
+ * Get a specific alias by path
1609
+ * @param aliasPath - The path of the alias
1610
+ */
1611
+ getAlias(aliasPath: string): A_StaticAlias | undefined;
1612
+ /**
1613
+ * Add multiple aliases at once
1614
+ * @param aliases - Array of alias configurations
1615
+ */
1616
+ addAliases(aliases: A_StaticDirectoryConfig[]): void;
1617
+ /**
1618
+ * Clear all aliases
1619
+ */
1620
+ clearAliases(): void;
1621
+ /**
1622
+ * Update an existing alias
1623
+ * @param aliasPath - The path of the alias to update
1624
+ * @param updates - Partial updates to apply
1625
+ */
1626
+ updateAlias(aliasPath: string, updates: Partial<A_StaticAlias>): boolean;
1627
+ /**
1628
+ * Get statistics about configured aliases
1629
+ */
1630
+ getStats(): {
1631
+ total: number;
1632
+ enabled: number;
1633
+ disabled: number;
1634
+ directories: string[];
1635
+ };
1636
+ /**
1637
+ * Checks if a given path is configured in the proxy (legacy method)
1638
+ * @deprecated Use findMatchingAlias instead
1639
+ * @param path
1640
+ * @returns
1641
+ */
1642
+ has(path: string): boolean;
1643
+ /**
1644
+ * Gets the directory for a given path if configured (legacy method)
1645
+ *
1646
+ * @param path
1647
+ * @returns
1648
+ */
1649
+ get(path: string): string | undefined;
1650
+ }
1651
+
1652
+ declare class A_StaticLoader extends A_Component {
1653
+ private _fsPolyfill;
1654
+ private _pathPolyfill;
1655
+ load(logger: A_Logger, config: A_StaticConfig, polyfill: A_Polyfill): Promise<void>;
1656
+ [A_HttpServerFeatures.onRequest](req: A_Request, res: A_Response, logger: A_Logger, config: A_StaticConfig, polyfill: A_Polyfill): Promise<void>;
1657
+ /**
1658
+ * Add a custom static file alias through the config
1659
+ * @param alias - The URL path alias (e.g., '/assets')
1660
+ * @param directory - The local directory path
1661
+ * @param path - Optional custom path (defaults to alias)
1662
+ * @param config - Static config instance
1663
+ * @param logger - Logger instance for logging
1664
+ */
1665
+ addAlias(alias: string, directory: string, config: A_StaticConfig, logger?: A_Logger, path?: string): void;
1666
+ /**
1667
+ * Remove a static file alias through the config
1668
+ * @param aliasPath - The path of the alias to remove
1669
+ * @param config - Static config instance
1670
+ * @param logger - Logger instance for logging
1671
+ */
1672
+ removeAlias(aliasPath: string, config: A_StaticConfig, logger?: A_Logger): boolean;
1673
+ /**
1674
+ * Get all configured aliases from config
1675
+ * @param config - Static config instance
1676
+ */
1677
+ getAliases(config: A_StaticConfig): A_StaticAlias[];
1678
+ /**
1679
+ * Enable or disable an alias
1680
+ * @param aliasPath - The path of the alias
1681
+ * @param enabled - Whether to enable or disable
1682
+ * @param config - Static config instance
1683
+ * @param logger - Logger instance for logging
1684
+ */
1685
+ setAliasEnabled(aliasPath: string, enabled: boolean, config: A_StaticConfig, logger?: A_Logger): boolean;
1686
+ protected getMimeType(ext: string): string;
1687
+ protected safeFilePath(staticDir: string, reqUrl: string, host: string | undefined, pathPolyfill: any, fsPolyfill: any): string;
1688
+ protected serveFile(filePath: string, res: A_Response, logger: A_Logger, fsPolyfill: any, pathPolyfill: any): Promise<void>;
1689
+ protected getCacheControl(ext: string): string;
1690
+ }
1691
+
1692
+ type A_SERVER_TYPES__StaticLoader_Init = {
1693
+ /**
1694
+ * Path to the static files directory
1695
+ */
1696
+ staticFilesPath: string;
1697
+ };
1698
+
1699
+ export { A_HttpRequestData, A_HttpServer, A_HttpServerError, type A_HttpServerError_Init, type A_HttpServerError_Serialized, type A_HttpServerFeatureNames, A_HttpServerFeatures, A_HttpServerRequestContext, type A_HttpServerRequestMethod, A_ProxyConfig, A_Request, A_RequestEnvVariables, A_RequestEnvVariablesArray, type A_RequestEnvVariablesType, A_RequestError, type A_RequestFeatureNames, A_RequestFeatures, A_RequestHelper, type A_Request_BodyType, A_Request_Event, type A_Request_EventCallback, type A_Request_FileUpload, type A_Request_Init, type A_Request_Listener, type A_Request_Methods, type A_Request_Options, type A_Request_ParsedBody, type A_Request_Serialized, type A_Request_SessionData, type A_Request_ValidationResult, A_Response, A_ResponseError, type A_ResponseFeatureNames, A_ResponseFeatures, type A_Response_CacheOptions, type A_Response_CompressionOptions, type A_Response_Constructor, type A_Response_CookieOptions, type A_Response_DownloadOptions, type A_Response_Listener, type A_Response_Options, type A_Response_SendResponseObject, type A_Response_Serialized, type A_Response_StreamOptions, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES, A_SERVER_CONSTANTS__DEFAULT_ENV_VARIABLES_ARRAY, type A_SERVER_TYPES__A_EntityListConstructor, A_SERVER_TYPES__A_EntityListEvent, type A_SERVER_TYPES__A_EntityListPagination, type A_SERVER_TYPES__A_EntityListSerialized, type A_SERVER_TYPES__ProxyConfigConstructor, type A_SERVER_TYPES__ProxyConfigConstructorConfig, type A_SERVER_TYPES__RoutesConfig, type A_SERVER_TYPES__ServerConstructor, type A_SERVER_TYPES__ServerError_Init, type A_SERVER_TYPES__ServerError_Serialized, type A_SERVER_TYPES__ServerLoggerEnvVariables, type A_SERVER_TYPES__ServerLoggerRouteParams, type A_SERVER_TYPES__StaticLoader_Init, A_SERVER__A_SERVER_LOGGER_ENV_VARIABLES, A_Server, A_ServerController, A_ServerEntityList, A_ServerError, A_ServerListQueryFilter, A_ServerLogger, A_ServerMiddleware, A_ServerProxy, A_ServerRoute, type A_ServerRouteHttpMethodNames, A_ServerRouteHttpMethods, A_ServerRouteProtocols, A_ServerRouter, A_ServerRouterDefineDecorator, A_ServerRouterMeta, type A_ServerRouterMetaKeyNames, A_ServerRouterMetaKeys, type A_ServerRouterMetaStructure, type A_ServerRouterRouteConfig, type A_ServerRouterRouteDefinition, type A_StaticAlias, A_StaticConfig, type A_StaticDirectoryConfig, A_StaticLoader, type A_TYPES__ServerENVVariables, type A_serverRouteProtocolNames, PROXY_CONFIG_DEFAULTS };