@mionjs/router 0.8.8 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.dist/cjs/.mion/types/A0Qb_D32xQCR.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_D32xQCR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_D5PMNNO.cjs +17 -0
- package/.dist/cjs/.mion/types/A0Qb_D5PMNNO.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_E1CjDEA.cjs +36 -0
- package/.dist/cjs/.mion/types/A0Qb_E1CjDEA.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_EYEglde.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_EYEglde.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_EyHLuYw.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_EyHLuYw.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_G42dZdW.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_G42dZdW.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_HSE8icr.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_HSE8icr.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_HXAy3Lx.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_HXAy3Lx.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_JJrCj9i.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_JJrCj9i.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_KDyf2Fa.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_KDyf2Fa.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_L3mQkaR.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_L3mQkaR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_RAudOr2.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_RAudOr2.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_TRnIbow.cjs +17 -0
- package/.dist/cjs/.mion/types/A0Qb_TRnIbow.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_UOI3bXq.cjs +17 -0
- package/.dist/cjs/.mion/types/A0Qb_UOI3bXq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_VsWxRKn.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_VsWxRKn.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_ZTKzxQG.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_ZTKzxQG.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_b4tYK8X.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_b4tYK8X.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_deFq9zY.cjs +26 -0
- package/.dist/cjs/.mion/types/A0Qb_deFq9zY.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_fMIJ1JT.cjs +14 -0
- package/.dist/cjs/.mion/types/A0Qb_fMIJ1JT.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_g17turq.cjs +13 -0
- package/.dist/cjs/.mion/types/A0Qb_g17turq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_hqa3Nzs.cjs +14 -0
- package/.dist/cjs/.mion/types/A0Qb_hqa3Nzs.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_iKPrxW9.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_iKPrxW9.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_jLtJ5Kv.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_jLtJ5Kv.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_kibOHkN.cjs +14 -0
- package/.dist/cjs/.mion/types/A0Qb_kibOHkN.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_kz5ne4c.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_kz5ne4c.cjs.map +1 -0
- package/.dist/cjs/.mion/types/A0Qb_pzBRrJb.cjs +16 -0
- package/.dist/cjs/.mion/types/A0Qb_pzBRrJb.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_EYEglde.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_EYEglde.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_EyHLuYw.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_EyHLuYw.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_HSE8icr.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_HSE8icr.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_HXAy3Lx.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_HXAy3Lx.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_JJrCj9i.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_JJrCj9i.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_KDyf2Fa.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_KDyf2Fa.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_L3mQkaR.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_L3mQkaR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_RAudOr2.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_RAudOr2.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_TRnIbow.cjs +17 -0
- package/.dist/cjs/.mion/types/Eq2V_TRnIbow.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_UOI3bXq.cjs +17 -0
- package/.dist/cjs/.mion/types/Eq2V_UOI3bXq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_VsWxRKn.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_VsWxRKn.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_ZTKzxQG.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_ZTKzxQG.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_b4tYK8X.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_b4tYK8X.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_deFq9zY.cjs +26 -0
- package/.dist/cjs/.mion/types/Eq2V_deFq9zY.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_g17turq.cjs +13 -0
- package/.dist/cjs/.mion/types/Eq2V_g17turq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_iKPrxW9.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_iKPrxW9.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_jLtJ5Kv.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_jLtJ5Kv.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_kz5ne4c.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_kz5ne4c.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Eq2V_pzBRrJb.cjs +16 -0
- package/.dist/cjs/.mion/types/Eq2V_pzBRrJb.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_D32xQCR.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_D32xQCR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_D5PMNNO.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_D5PMNNO.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_E1CjDEA.cjs +32 -0
- package/.dist/cjs/.mion/types/Ky89_E1CjDEA.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_EYEglde.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_EYEglde.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_EyHLuYw.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_EyHLuYw.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_G42dZdW.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_G42dZdW.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_HSE8icr.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_HSE8icr.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_JJrCj9i.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_JJrCj9i.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_KDyf2Fa.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_KDyf2Fa.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_L3mQkaR.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_L3mQkaR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_RAudOr2.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_RAudOr2.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_TRnIbow.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_TRnIbow.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_UOI3bXq.cjs +17 -0
- package/.dist/cjs/.mion/types/Ky89_UOI3bXq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_ZTKzxQG.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_ZTKzxQG.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_b4tYK8X.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_b4tYK8X.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_deFq9zY.cjs +26 -0
- package/.dist/cjs/.mion/types/Ky89_deFq9zY.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_fMIJ1JT.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_fMIJ1JT.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_g17turq.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_g17turq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_hqa3Nzs.cjs +14 -0
- package/.dist/cjs/.mion/types/Ky89_hqa3Nzs.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_iKPrxW9.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_iKPrxW9.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_jLtJ5Kv.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_jLtJ5Kv.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_kibOHkN.cjs +13 -0
- package/.dist/cjs/.mion/types/Ky89_kibOHkN.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_kz5ne4c.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_kz5ne4c.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Ky89_pzBRrJb.cjs +16 -0
- package/.dist/cjs/.mion/types/Ky89_pzBRrJb.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_D32xQCR.cjs +23 -0
- package/.dist/cjs/.mion/types/OBOg_D32xQCR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_D5PMNNO.cjs +18 -0
- package/.dist/cjs/.mion/types/OBOg_D5PMNNO.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_E1CjDEA.cjs +18 -0
- package/.dist/cjs/.mion/types/OBOg_E1CjDEA.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_G42dZdW.cjs +18 -0
- package/.dist/cjs/.mion/types/OBOg_G42dZdW.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_LKYfhxm.cjs +18 -0
- package/.dist/cjs/.mion/types/OBOg_LKYfhxm.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_fMIJ1JT.cjs +18 -0
- package/.dist/cjs/.mion/types/OBOg_fMIJ1JT.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_g17turq.cjs +17 -0
- package/.dist/cjs/.mion/types/OBOg_g17turq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_hqa3Nzs.cjs +17 -0
- package/.dist/cjs/.mion/types/OBOg_hqa3Nzs.cjs.map +1 -0
- package/.dist/cjs/.mion/types/OBOg_kibOHkN.cjs +17 -0
- package/.dist/cjs/.mion/types/OBOg_kibOHkN.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_D32xQCR.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_D32xQCR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_D5PMNNO.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_D5PMNNO.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_E1CjDEA.cjs +29 -0
- package/.dist/cjs/.mion/types/Xhuv_E1CjDEA.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_EYEglde.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_EYEglde.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_EyHLuYw.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_EyHLuYw.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_G42dZdW.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_G42dZdW.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_HSE8icr.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_HSE8icr.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_HXAy3Lx.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_HXAy3Lx.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_JJrCj9i.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_JJrCj9i.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_KDyf2Fa.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_KDyf2Fa.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_L3mQkaR.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_L3mQkaR.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_LKYfhxm.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_LKYfhxm.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_RAudOr2.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_RAudOr2.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_TRnIbow.cjs +17 -0
- package/.dist/cjs/.mion/types/Xhuv_TRnIbow.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_UOI3bXq.cjs +17 -0
- package/.dist/cjs/.mion/types/Xhuv_UOI3bXq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_VsWxRKn.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_VsWxRKn.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_ZTKzxQG.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_ZTKzxQG.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_ZgsWs6s.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_ZgsWs6s.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_b4tYK8X.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_b4tYK8X.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_deFq9zY.cjs +26 -0
- package/.dist/cjs/.mion/types/Xhuv_deFq9zY.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_fMIJ1JT.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_fMIJ1JT.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_g17turq.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_g17turq.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_hqa3Nzs.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_hqa3Nzs.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_iKPrxW9.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_iKPrxW9.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_jLtJ5Kv.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_jLtJ5Kv.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_kibOHkN.cjs +13 -0
- package/.dist/cjs/.mion/types/Xhuv_kibOHkN.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_kz5ne4c.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_kz5ne4c.cjs.map +1 -0
- package/.dist/cjs/.mion/types/Xhuv_pzBRrJb.cjs +16 -0
- package/.dist/cjs/.mion/types/Xhuv_pzBRrJb.cjs.map +1 -0
- package/.dist/cjs/.mion/types/mzca_fMIJ1JT.cjs +14 -0
- package/.dist/cjs/.mion/types/mzca_fMIJ1JT.cjs.map +1 -0
- package/.dist/cjs/.mion/types/mzca_hqa3Nzs.cjs +14 -0
- package/.dist/cjs/.mion/types/mzca_hqa3Nzs.cjs.map +1 -0
- package/.dist/cjs/.mion/types/mzca_kibOHkN.cjs +14 -0
- package/.dist/cjs/.mion/types/mzca_kibOHkN.cjs.map +1 -0
- package/.dist/cjs/.mion/types/pf/@mionjs/run-types/rXVwGkGDX08BsQ.cjs +14 -0
- package/.dist/cjs/.mion/types/pf/@mionjs/run-types/rXVwGkGDX08BsQ.cjs.map +1 -0
- package/.dist/cjs/.mion/types/pf/@mionjs/run-types/tfRjnFZVF8lqI_.cjs +14 -0
- package/.dist/cjs/.mion/types/pf/@mionjs/run-types/tfRjnFZVF8lqI_.cjs.map +1 -0
- package/.dist/cjs/.mion/types/rt/C7ezVBCtGn.cjs +498 -0
- package/.dist/cjs/.mion/types/rt/C7ezVBCtGn.cjs.map +1 -0
- package/.dist/cjs/.mion/types/rt/VIdAjpHu1X.cjs +526 -0
- package/.dist/cjs/.mion/types/rt/VIdAjpHu1X.cjs.map +1 -0
- package/.dist/cjs/.mion/types/rt/eF4wQzU6Fd.cjs +876 -0
- package/.dist/cjs/.mion/types/rt/eF4wQzU6Fd.cjs.map +1 -0
- package/.dist/cjs/.mion/types/rt/shared/JQEexHbHMp.cjs +467 -0
- package/.dist/cjs/.mion/types/rt/shared/JQEexHbHMp.cjs.map +1 -0
- package/.dist/cjs/.mion/types/rt/shared/connsmWgsp.cjs +1475 -0
- package/.dist/cjs/.mion/types/rt/shared/connsmWgsp.cjs.map +1 -0
- package/.dist/cjs/index.cjs +115 -153
- package/.dist/cjs/index.d.ts +5 -4
- package/.dist/cjs/middlewares.cjs +5 -0
- package/.dist/cjs/middlewares.d.ts +3 -0
- package/.dist/cjs/src/batches.cjs +332 -0
- package/.dist/cjs/src/batches.cjs.map +1 -0
- package/.dist/cjs/src/batches.d.ts +22 -0
- package/.dist/cjs/src/callContext.cjs +72 -116
- package/.dist/cjs/src/callContext.cjs.map +1 -1
- package/.dist/cjs/src/callContext.d.ts +5 -8
- package/.dist/cjs/src/constants.cjs +22 -41
- package/.dist/cjs/src/constants.cjs.map +1 -1
- package/.dist/cjs/src/constants.d.ts +1 -7
- package/.dist/cjs/src/dispatch.cjs +227 -129
- package/.dist/cjs/src/dispatch.cjs.map +1 -1
- package/.dist/cjs/src/dispatch.d.ts +8 -2
- package/.dist/cjs/src/lib/bodyLimit.cjs +37 -0
- package/.dist/cjs/src/lib/bodyLimit.cjs.map +1 -0
- package/.dist/cjs/src/lib/bodyLimit.d.ts +5 -0
- package/.dist/cjs/src/lib/bodyReader.cjs +79 -0
- package/.dist/cjs/src/lib/bodyReader.cjs.map +1 -0
- package/.dist/cjs/src/lib/bodyReader.d.ts +10 -0
- package/.dist/cjs/src/lib/dispatchError.cjs +77 -34
- package/.dist/cjs/src/lib/dispatchError.cjs.map +1 -1
- package/.dist/cjs/src/lib/dispatchError.d.ts +6 -2
- package/.dist/cjs/src/lib/handlers.cjs +91 -44
- package/.dist/cjs/src/lib/handlers.cjs.map +1 -1
- package/.dist/cjs/src/lib/handlers.d.ts +14 -9
- package/.dist/cjs/src/lib/headers.cjs +172 -55
- package/.dist/cjs/src/lib/headers.cjs.map +1 -1
- package/.dist/cjs/src/lib/headers.d.ts +40 -1
- package/.dist/cjs/src/lib/queryBody.cjs +25 -29
- package/.dist/cjs/src/lib/queryBody.cjs.map +1 -1
- package/.dist/cjs/src/lib/queryBody.d.ts +0 -1
- package/.dist/cjs/src/lib/reflection.cjs +78 -371
- package/.dist/cjs/src/lib/reflection.cjs.map +1 -1
- package/.dist/cjs/src/lib/reflection.d.ts +12 -9
- package/.dist/cjs/src/lib/remoteMethods.cjs +104 -104
- package/.dist/cjs/src/lib/remoteMethods.cjs.map +1 -1
- package/.dist/cjs/src/lib/remoteMethods.d.ts +4 -4
- package/.dist/cjs/src/lib/urlQuery.cjs +24 -0
- package/.dist/cjs/src/lib/urlQuery.cjs.map +1 -0
- package/.dist/cjs/src/lib/urlQuery.d.ts +2 -0
- package/.dist/cjs/src/middlewares/fetchMetadata.cjs +99 -0
- package/.dist/cjs/src/middlewares/fetchMetadata.cjs.map +1 -0
- package/.dist/cjs/src/middlewares/fetchMetadata.d.ts +15 -0
- package/.dist/cjs/src/middlewares/syncRoutes.cjs +67 -0
- package/.dist/cjs/src/middlewares/syncRoutes.cjs.map +1 -0
- package/.dist/cjs/src/middlewares/syncRoutes.d.ts +12 -0
- package/.dist/cjs/src/router.cjs +506 -432
- package/.dist/cjs/src/router.cjs.map +1 -1
- package/.dist/cjs/src/router.d.ts +27 -19
- package/.dist/cjs/src/routes/errors.routes.cjs +81 -46
- package/.dist/cjs/src/routes/errors.routes.cjs.map +1 -1
- package/.dist/cjs/src/routes/errors.routes.d.ts +14 -3
- package/.dist/cjs/src/routes/serializer.routes.cjs +107 -176
- package/.dist/cjs/src/routes/serializer.routes.cjs.map +1 -1
- package/.dist/cjs/src/routes/serializer.routes.d.ts +3 -3
- package/.dist/cjs/src/types/context.cjs +0 -31
- package/.dist/cjs/src/types/context.d.ts +13 -21
- package/.dist/cjs/src/types/definitions.cjs +0 -15
- package/.dist/cjs/src/types/definitions.d.ts +32 -20
- package/.dist/cjs/src/types/general.cjs +0 -14
- package/.dist/cjs/src/types/general.d.ts +15 -15
- package/.dist/cjs/src/types/guards.cjs +31 -38
- package/.dist/cjs/src/types/guards.cjs.map +1 -1
- package/.dist/cjs/src/types/guards.d.ts +7 -7
- package/.dist/cjs/src/types/handlers.cjs +0 -13
- package/.dist/cjs/src/types/handlers.d.ts +8 -5
- package/.dist/cjs/src/types/mionRouter.cjs +0 -0
- package/.dist/cjs/src/types/mionRouter.d.ts +44 -0
- package/.dist/cjs/src/types/parser.cjs +0 -0
- package/.dist/cjs/src/types/parser.d.ts +43 -0
- package/.dist/cjs/src/types/publicMethods.cjs +0 -24
- package/.dist/cjs/src/types/publicMethods.d.ts +65 -25
- package/.dist/cjs/src/types/remoteMethods.cjs +0 -25
- package/.dist/cjs/src/types/remoteMethods.d.ts +49 -29
- package/.dist/cjs/src/types/resolvedOptions.cjs +0 -0
- package/.dist/cjs/src/types/resolvedOptions.d.ts +28 -0
- package/.dist/esm/.mion/types/A0Qb_D32xQCR.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_D32xQCR.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_D5PMNNO.js +17 -0
- package/.dist/esm/.mion/types/A0Qb_D5PMNNO.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_E1CjDEA.js +36 -0
- package/.dist/esm/.mion/types/A0Qb_E1CjDEA.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_EYEglde.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_EYEglde.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_EyHLuYw.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_EyHLuYw.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_G42dZdW.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_G42dZdW.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_HSE8icr.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_HSE8icr.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_HXAy3Lx.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_HXAy3Lx.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_JJrCj9i.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_JJrCj9i.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_KDyf2Fa.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_KDyf2Fa.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_L3mQkaR.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_L3mQkaR.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_RAudOr2.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_RAudOr2.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_TRnIbow.js +17 -0
- package/.dist/esm/.mion/types/A0Qb_TRnIbow.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_UOI3bXq.js +17 -0
- package/.dist/esm/.mion/types/A0Qb_UOI3bXq.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_VsWxRKn.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_VsWxRKn.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_ZTKzxQG.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_ZTKzxQG.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_b4tYK8X.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_b4tYK8X.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_deFq9zY.js +26 -0
- package/.dist/esm/.mion/types/A0Qb_deFq9zY.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_fMIJ1JT.js +14 -0
- package/.dist/esm/.mion/types/A0Qb_fMIJ1JT.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_g17turq.js +13 -0
- package/.dist/esm/.mion/types/A0Qb_g17turq.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_hqa3Nzs.js +14 -0
- package/.dist/esm/.mion/types/A0Qb_hqa3Nzs.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_iKPrxW9.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_iKPrxW9.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_jLtJ5Kv.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_jLtJ5Kv.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_kibOHkN.js +14 -0
- package/.dist/esm/.mion/types/A0Qb_kibOHkN.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_kz5ne4c.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_kz5ne4c.js.map +1 -0
- package/.dist/esm/.mion/types/A0Qb_pzBRrJb.js +16 -0
- package/.dist/esm/.mion/types/A0Qb_pzBRrJb.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_EYEglde.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_EYEglde.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_EyHLuYw.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_EyHLuYw.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_HSE8icr.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_HSE8icr.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_HXAy3Lx.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_HXAy3Lx.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_JJrCj9i.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_JJrCj9i.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_KDyf2Fa.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_KDyf2Fa.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_L3mQkaR.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_L3mQkaR.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_RAudOr2.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_RAudOr2.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_TRnIbow.js +17 -0
- package/.dist/esm/.mion/types/Eq2V_TRnIbow.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_UOI3bXq.js +17 -0
- package/.dist/esm/.mion/types/Eq2V_UOI3bXq.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_VsWxRKn.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_VsWxRKn.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_ZTKzxQG.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_ZTKzxQG.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_b4tYK8X.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_b4tYK8X.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_deFq9zY.js +26 -0
- package/.dist/esm/.mion/types/Eq2V_deFq9zY.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_g17turq.js +13 -0
- package/.dist/esm/.mion/types/Eq2V_g17turq.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_iKPrxW9.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_iKPrxW9.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_jLtJ5Kv.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_jLtJ5Kv.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_kz5ne4c.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_kz5ne4c.js.map +1 -0
- package/.dist/esm/.mion/types/Eq2V_pzBRrJb.js +16 -0
- package/.dist/esm/.mion/types/Eq2V_pzBRrJb.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_D32xQCR.js +16 -0
- package/.dist/esm/.mion/types/Ky89_D32xQCR.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_D5PMNNO.js +16 -0
- package/.dist/esm/.mion/types/Ky89_D5PMNNO.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_E1CjDEA.js +32 -0
- package/.dist/esm/.mion/types/Ky89_E1CjDEA.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_EYEglde.js +16 -0
- package/.dist/esm/.mion/types/Ky89_EYEglde.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_EyHLuYw.js +16 -0
- package/.dist/esm/.mion/types/Ky89_EyHLuYw.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_G42dZdW.js +16 -0
- package/.dist/esm/.mion/types/Ky89_G42dZdW.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_HSE8icr.js +16 -0
- package/.dist/esm/.mion/types/Ky89_HSE8icr.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_JJrCj9i.js +13 -0
- package/.dist/esm/.mion/types/Ky89_JJrCj9i.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_KDyf2Fa.js +16 -0
- package/.dist/esm/.mion/types/Ky89_KDyf2Fa.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_L3mQkaR.js +13 -0
- package/.dist/esm/.mion/types/Ky89_L3mQkaR.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_RAudOr2.js +13 -0
- package/.dist/esm/.mion/types/Ky89_RAudOr2.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_TRnIbow.js +13 -0
- package/.dist/esm/.mion/types/Ky89_TRnIbow.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_UOI3bXq.js +17 -0
- package/.dist/esm/.mion/types/Ky89_UOI3bXq.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_ZTKzxQG.js +16 -0
- package/.dist/esm/.mion/types/Ky89_ZTKzxQG.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_b4tYK8X.js +16 -0
- package/.dist/esm/.mion/types/Ky89_b4tYK8X.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_deFq9zY.js +26 -0
- package/.dist/esm/.mion/types/Ky89_deFq9zY.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_fMIJ1JT.js +13 -0
- package/.dist/esm/.mion/types/Ky89_fMIJ1JT.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_g17turq.js +13 -0
- package/.dist/esm/.mion/types/Ky89_g17turq.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_hqa3Nzs.js +14 -0
- package/.dist/esm/.mion/types/Ky89_hqa3Nzs.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_iKPrxW9.js +16 -0
- package/.dist/esm/.mion/types/Ky89_iKPrxW9.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_jLtJ5Kv.js +16 -0
- package/.dist/esm/.mion/types/Ky89_jLtJ5Kv.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_kibOHkN.js +13 -0
- package/.dist/esm/.mion/types/Ky89_kibOHkN.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_kz5ne4c.js +16 -0
- package/.dist/esm/.mion/types/Ky89_kz5ne4c.js.map +1 -0
- package/.dist/esm/.mion/types/Ky89_pzBRrJb.js +16 -0
- package/.dist/esm/.mion/types/Ky89_pzBRrJb.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_D32xQCR.js +23 -0
- package/.dist/esm/.mion/types/OBOg_D32xQCR.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_D5PMNNO.js +18 -0
- package/.dist/esm/.mion/types/OBOg_D5PMNNO.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_E1CjDEA.js +18 -0
- package/.dist/esm/.mion/types/OBOg_E1CjDEA.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_G42dZdW.js +18 -0
- package/.dist/esm/.mion/types/OBOg_G42dZdW.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_LKYfhxm.js +18 -0
- package/.dist/esm/.mion/types/OBOg_LKYfhxm.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_fMIJ1JT.js +18 -0
- package/.dist/esm/.mion/types/OBOg_fMIJ1JT.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_g17turq.js +17 -0
- package/.dist/esm/.mion/types/OBOg_g17turq.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_hqa3Nzs.js +17 -0
- package/.dist/esm/.mion/types/OBOg_hqa3Nzs.js.map +1 -0
- package/.dist/esm/.mion/types/OBOg_kibOHkN.js +17 -0
- package/.dist/esm/.mion/types/OBOg_kibOHkN.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_D32xQCR.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_D32xQCR.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_D5PMNNO.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_D5PMNNO.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_E1CjDEA.js +29 -0
- package/.dist/esm/.mion/types/Xhuv_E1CjDEA.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_EYEglde.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_EYEglde.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_EyHLuYw.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_EyHLuYw.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_G42dZdW.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_G42dZdW.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_HSE8icr.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_HSE8icr.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_HXAy3Lx.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_HXAy3Lx.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_JJrCj9i.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_JJrCj9i.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_KDyf2Fa.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_KDyf2Fa.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_L3mQkaR.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_L3mQkaR.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_LKYfhxm.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_LKYfhxm.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_RAudOr2.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_RAudOr2.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_TRnIbow.js +17 -0
- package/.dist/esm/.mion/types/Xhuv_TRnIbow.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_UOI3bXq.js +17 -0
- package/.dist/esm/.mion/types/Xhuv_UOI3bXq.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_VsWxRKn.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_VsWxRKn.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_ZTKzxQG.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_ZTKzxQG.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_ZgsWs6s.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_ZgsWs6s.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_b4tYK8X.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_b4tYK8X.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_deFq9zY.js +26 -0
- package/.dist/esm/.mion/types/Xhuv_deFq9zY.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_fMIJ1JT.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_fMIJ1JT.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_g17turq.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_g17turq.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_hqa3Nzs.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_hqa3Nzs.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_iKPrxW9.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_iKPrxW9.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_jLtJ5Kv.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_jLtJ5Kv.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_kibOHkN.js +13 -0
- package/.dist/esm/.mion/types/Xhuv_kibOHkN.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_kz5ne4c.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_kz5ne4c.js.map +1 -0
- package/.dist/esm/.mion/types/Xhuv_pzBRrJb.js +16 -0
- package/.dist/esm/.mion/types/Xhuv_pzBRrJb.js.map +1 -0
- package/.dist/esm/.mion/types/mzca_fMIJ1JT.js +14 -0
- package/.dist/esm/.mion/types/mzca_fMIJ1JT.js.map +1 -0
- package/.dist/esm/.mion/types/mzca_hqa3Nzs.js +14 -0
- package/.dist/esm/.mion/types/mzca_hqa3Nzs.js.map +1 -0
- package/.dist/esm/.mion/types/mzca_kibOHkN.js +14 -0
- package/.dist/esm/.mion/types/mzca_kibOHkN.js.map +1 -0
- package/.dist/esm/.mion/types/pf/@mionjs/run-types/rXVwGkGDX08BsQ.js +14 -0
- package/.dist/esm/.mion/types/pf/@mionjs/run-types/rXVwGkGDX08BsQ.js.map +1 -0
- package/.dist/esm/.mion/types/pf/@mionjs/run-types/tfRjnFZVF8lqI_.js +14 -0
- package/.dist/esm/.mion/types/pf/@mionjs/run-types/tfRjnFZVF8lqI_.js.map +1 -0
- package/.dist/esm/.mion/types/rt/C7ezVBCtGn.js +495 -0
- package/.dist/esm/.mion/types/rt/C7ezVBCtGn.js.map +1 -0
- package/.dist/esm/.mion/types/rt/VIdAjpHu1X.js +521 -0
- package/.dist/esm/.mion/types/rt/VIdAjpHu1X.js.map +1 -0
- package/.dist/esm/.mion/types/rt/eF4wQzU6Fd.js +873 -0
- package/.dist/esm/.mion/types/rt/eF4wQzU6Fd.js.map +1 -0
- package/.dist/esm/.mion/types/rt/shared/JQEexHbHMp.js +467 -0
- package/.dist/esm/.mion/types/rt/shared/JQEexHbHMp.js.map +1 -0
- package/.dist/esm/.mion/types/rt/shared/connsmWgsp.js +1475 -0
- package/.dist/esm/.mion/types/rt/shared/connsmWgsp.js.map +1 -0
- package/.dist/esm/index.d.ts +5 -4
- package/.dist/esm/index.js +11 -145
- package/.dist/esm/middlewares.d.ts +3 -0
- package/.dist/esm/middlewares.js +3 -0
- package/.dist/esm/src/batches.d.ts +22 -0
- package/.dist/esm/src/batches.js +321 -0
- package/.dist/esm/src/batches.js.map +1 -0
- package/.dist/esm/src/callContext.d.ts +5 -8
- package/.dist/esm/src/callContext.js +70 -118
- package/.dist/esm/src/callContext.js.map +1 -1
- package/.dist/esm/src/constants.d.ts +1 -7
- package/.dist/esm/src/constants.js +22 -44
- package/.dist/esm/src/constants.js.map +1 -1
- package/.dist/esm/src/dispatch.d.ts +8 -2
- package/.dist/esm/src/dispatch.js +223 -131
- package/.dist/esm/src/dispatch.js.map +1 -1
- package/.dist/esm/src/lib/bodyLimit.d.ts +5 -0
- package/.dist/esm/src/lib/bodyLimit.js +35 -0
- package/.dist/esm/src/lib/bodyLimit.js.map +1 -0
- package/.dist/esm/src/lib/bodyReader.d.ts +10 -0
- package/.dist/esm/src/lib/bodyReader.js +76 -0
- package/.dist/esm/src/lib/bodyReader.js.map +1 -0
- package/.dist/esm/src/lib/dispatchError.d.ts +6 -2
- package/.dist/esm/src/lib/dispatchError.js +72 -36
- package/.dist/esm/src/lib/dispatchError.js.map +1 -1
- package/.dist/esm/src/lib/handlers.d.ts +14 -9
- package/.dist/esm/src/lib/handlers.js +85 -48
- package/.dist/esm/src/lib/handlers.js.map +1 -1
- package/.dist/esm/src/lib/headers.d.ts +40 -1
- package/.dist/esm/src/lib/headers.js +167 -57
- package/.dist/esm/src/lib/headers.js.map +1 -1
- package/.dist/esm/src/lib/queryBody.d.ts +0 -1
- package/.dist/esm/src/lib/queryBody.js +26 -31
- package/.dist/esm/src/lib/queryBody.js.map +1 -1
- package/.dist/esm/src/lib/reflection.d.ts +12 -9
- package/.dist/esm/src/lib/reflection.js +75 -351
- package/.dist/esm/src/lib/reflection.js.map +1 -1
- package/.dist/esm/src/lib/remoteMethods.d.ts +4 -4
- package/.dist/esm/src/lib/remoteMethods.js +105 -111
- package/.dist/esm/src/lib/remoteMethods.js.map +1 -1
- package/.dist/esm/src/lib/urlQuery.d.ts +2 -0
- package/.dist/esm/src/lib/urlQuery.js +23 -0
- package/.dist/esm/src/lib/urlQuery.js.map +1 -0
- package/.dist/esm/src/middlewares/fetchMetadata.d.ts +15 -0
- package/.dist/esm/src/middlewares/fetchMetadata.js +97 -0
- package/.dist/esm/src/middlewares/fetchMetadata.js.map +1 -0
- package/.dist/esm/src/middlewares/syncRoutes.d.ts +12 -0
- package/.dist/esm/src/middlewares/syncRoutes.js +66 -0
- package/.dist/esm/src/middlewares/syncRoutes.js.map +1 -0
- package/.dist/esm/src/router.d.ts +27 -19
- package/.dist/esm/src/router.js +477 -449
- package/.dist/esm/src/router.js.map +1 -1
- package/.dist/esm/src/routes/errors.routes.d.ts +14 -3
- package/.dist/esm/src/routes/errors.routes.js +80 -48
- package/.dist/esm/src/routes/errors.routes.js.map +1 -1
- package/.dist/esm/src/routes/serializer.routes.d.ts +3 -3
- package/.dist/esm/src/routes/serializer.routes.js +107 -179
- package/.dist/esm/src/routes/serializer.routes.js.map +1 -1
- package/.dist/esm/src/types/context.d.ts +13 -21
- package/.dist/esm/src/types/context.js +0 -31
- package/.dist/esm/src/types/definitions.d.ts +32 -20
- package/.dist/esm/src/types/definitions.js +0 -15
- package/.dist/esm/src/types/general.d.ts +15 -15
- package/.dist/esm/src/types/general.js +0 -14
- package/.dist/esm/src/types/guards.d.ts +7 -7
- package/.dist/esm/src/types/guards.js +27 -46
- package/.dist/esm/src/types/guards.js.map +1 -1
- package/.dist/esm/src/types/handlers.d.ts +8 -5
- package/.dist/esm/src/types/handlers.js +0 -13
- package/.dist/esm/src/types/mionRouter.d.ts +44 -0
- package/.dist/esm/src/types/mionRouter.js +0 -0
- package/.dist/esm/src/types/parser.d.ts +43 -0
- package/.dist/esm/src/types/parser.js +0 -0
- package/.dist/esm/src/types/publicMethods.d.ts +65 -25
- package/.dist/esm/src/types/publicMethods.js +0 -24
- package/.dist/esm/src/types/remoteMethods.d.ts +49 -29
- package/.dist/esm/src/types/remoteMethods.js +0 -25
- package/.dist/esm/src/types/resolvedOptions.d.ts +28 -0
- package/.dist/esm/src/types/resolvedOptions.js +0 -0
- package/LICENSE +1 -1
- package/README.md +6 -6
- package/package.json +21 -24
- package/.dist/cjs/index.cjs.map +0 -1
- package/.dist/cjs/index.d.ts.map +0 -1
- package/.dist/cjs/src/aot/aotCacheLoader.cjs +0 -11
- package/.dist/cjs/src/aot/aotCacheLoader.cjs.map +0 -1
- package/.dist/cjs/src/aot/aotCacheLoader.d.ts +0 -2
- package/.dist/cjs/src/aot/aotCacheLoader.d.ts.map +0 -1
- package/.dist/cjs/src/callContext.d.ts.map +0 -1
- package/.dist/cjs/src/constants.d.ts.map +0 -1
- package/.dist/cjs/src/defaultRoutes.cjs +0 -16
- package/.dist/cjs/src/defaultRoutes.cjs.map +0 -1
- package/.dist/cjs/src/defaultRoutes.d.ts +0 -4
- package/.dist/cjs/src/defaultRoutes.d.ts.map +0 -1
- package/.dist/cjs/src/dispatch.d.ts.map +0 -1
- package/.dist/cjs/src/lib/aotEmitter.cjs +0 -74
- package/.dist/cjs/src/lib/aotEmitter.cjs.map +0 -1
- package/.dist/cjs/src/lib/aotEmitter.d.ts +0 -24
- package/.dist/cjs/src/lib/aotEmitter.d.ts.map +0 -1
- package/.dist/cjs/src/lib/dispatchError.d.ts.map +0 -1
- package/.dist/cjs/src/lib/handlers.d.ts.map +0 -1
- package/.dist/cjs/src/lib/headers.d.ts.map +0 -1
- package/.dist/cjs/src/lib/methodsCache.cjs +0 -55
- package/.dist/cjs/src/lib/methodsCache.cjs.map +0 -1
- package/.dist/cjs/src/lib/methodsCache.d.ts +0 -12
- package/.dist/cjs/src/lib/methodsCache.d.ts.map +0 -1
- package/.dist/cjs/src/lib/queryBody.d.ts.map +0 -1
- package/.dist/cjs/src/lib/reflection.d.ts.map +0 -1
- package/.dist/cjs/src/lib/remoteMethods.d.ts.map +0 -1
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.cjs +0 -24
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.cjs.map +0 -1
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.d.ts +0 -5
- package/.dist/cjs/src/lib/test/aotEmitter-test-router.d.ts.map +0 -1
- package/.dist/cjs/src/router.d.ts.map +0 -1
- package/.dist/cjs/src/routes/client.routes.cjs +0 -76
- package/.dist/cjs/src/routes/client.routes.cjs.map +0 -1
- package/.dist/cjs/src/routes/client.routes.d.ts +0 -20
- package/.dist/cjs/src/routes/client.routes.d.ts.map +0 -1
- package/.dist/cjs/src/routes/errors.routes.d.ts.map +0 -1
- package/.dist/cjs/src/routes/mion.routes.cjs +0 -13
- package/.dist/cjs/src/routes/mion.routes.cjs.map +0 -1
- package/.dist/cjs/src/routes/mion.routes.d.ts +0 -10
- package/.dist/cjs/src/routes/mion.routes.d.ts.map +0 -1
- package/.dist/cjs/src/routes/serializer.routes.d.ts.map +0 -1
- package/.dist/cjs/src/routesFlow.cjs +0 -227
- package/.dist/cjs/src/routesFlow.cjs.map +0 -1
- package/.dist/cjs/src/routesFlow.d.ts +0 -8
- package/.dist/cjs/src/routesFlow.d.ts.map +0 -1
- package/.dist/cjs/src/types/context.cjs.map +0 -1
- package/.dist/cjs/src/types/context.d.ts.map +0 -1
- package/.dist/cjs/src/types/definitions.cjs.map +0 -1
- package/.dist/cjs/src/types/definitions.d.ts.map +0 -1
- package/.dist/cjs/src/types/general.cjs.map +0 -1
- package/.dist/cjs/src/types/general.d.ts.map +0 -1
- package/.dist/cjs/src/types/guards.d.ts.map +0 -1
- package/.dist/cjs/src/types/handlers.cjs.map +0 -1
- package/.dist/cjs/src/types/handlers.d.ts.map +0 -1
- package/.dist/cjs/src/types/publicMethods.cjs.map +0 -1
- package/.dist/cjs/src/types/publicMethods.d.ts.map +0 -1
- package/.dist/cjs/src/types/remoteMethods.cjs.map +0 -1
- package/.dist/cjs/src/types/remoteMethods.d.ts.map +0 -1
- package/.dist/esm/index.d.ts.map +0 -1
- package/.dist/esm/index.js.map +0 -1
- package/.dist/esm/src/aot/aotCacheLoader.d.ts +0 -2
- package/.dist/esm/src/aot/aotCacheLoader.d.ts.map +0 -1
- package/.dist/esm/src/aot/aotCacheLoader.js +0 -11
- package/.dist/esm/src/aot/aotCacheLoader.js.map +0 -1
- package/.dist/esm/src/callContext.d.ts.map +0 -1
- package/.dist/esm/src/constants.d.ts.map +0 -1
- package/.dist/esm/src/defaultRoutes.d.ts +0 -4
- package/.dist/esm/src/defaultRoutes.d.ts.map +0 -1
- package/.dist/esm/src/defaultRoutes.js +0 -16
- package/.dist/esm/src/defaultRoutes.js.map +0 -1
- package/.dist/esm/src/dispatch.d.ts.map +0 -1
- package/.dist/esm/src/lib/aotEmitter.d.ts +0 -24
- package/.dist/esm/src/lib/aotEmitter.d.ts.map +0 -1
- package/.dist/esm/src/lib/aotEmitter.js +0 -74
- package/.dist/esm/src/lib/aotEmitter.js.map +0 -1
- package/.dist/esm/src/lib/dispatchError.d.ts.map +0 -1
- package/.dist/esm/src/lib/handlers.d.ts.map +0 -1
- package/.dist/esm/src/lib/headers.d.ts.map +0 -1
- package/.dist/esm/src/lib/methodsCache.d.ts +0 -12
- package/.dist/esm/src/lib/methodsCache.d.ts.map +0 -1
- package/.dist/esm/src/lib/methodsCache.js +0 -56
- package/.dist/esm/src/lib/methodsCache.js.map +0 -1
- package/.dist/esm/src/lib/queryBody.d.ts.map +0 -1
- package/.dist/esm/src/lib/reflection.d.ts.map +0 -1
- package/.dist/esm/src/lib/remoteMethods.d.ts.map +0 -1
- package/.dist/esm/src/lib/test/aotEmitter-test-router.d.ts +0 -5
- package/.dist/esm/src/lib/test/aotEmitter-test-router.d.ts.map +0 -1
- package/.dist/esm/src/lib/test/aotEmitter-test-router.js +0 -24
- package/.dist/esm/src/lib/test/aotEmitter-test-router.js.map +0 -1
- package/.dist/esm/src/router.d.ts.map +0 -1
- package/.dist/esm/src/routes/client.routes.d.ts +0 -20
- package/.dist/esm/src/routes/client.routes.d.ts.map +0 -1
- package/.dist/esm/src/routes/client.routes.js +0 -76
- package/.dist/esm/src/routes/client.routes.js.map +0 -1
- package/.dist/esm/src/routes/errors.routes.d.ts.map +0 -1
- package/.dist/esm/src/routes/mion.routes.d.ts +0 -10
- package/.dist/esm/src/routes/mion.routes.d.ts.map +0 -1
- package/.dist/esm/src/routes/mion.routes.js +0 -13
- package/.dist/esm/src/routes/mion.routes.js.map +0 -1
- package/.dist/esm/src/routes/serializer.routes.d.ts.map +0 -1
- package/.dist/esm/src/routesFlow.d.ts +0 -8
- package/.dist/esm/src/routesFlow.d.ts.map +0 -1
- package/.dist/esm/src/routesFlow.js +0 -227
- package/.dist/esm/src/routesFlow.js.map +0 -1
- package/.dist/esm/src/types/context.d.ts.map +0 -1
- package/.dist/esm/src/types/context.js.map +0 -1
- package/.dist/esm/src/types/definitions.d.ts.map +0 -1
- package/.dist/esm/src/types/definitions.js.map +0 -1
- package/.dist/esm/src/types/general.d.ts.map +0 -1
- package/.dist/esm/src/types/general.js.map +0 -1
- package/.dist/esm/src/types/guards.d.ts.map +0 -1
- package/.dist/esm/src/types/handlers.d.ts.map +0 -1
- package/.dist/esm/src/types/handlers.js.map +0 -1
- package/.dist/esm/src/types/publicMethods.d.ts.map +0 -1
- package/.dist/esm/src/types/publicMethods.js.map +0 -1
- package/.dist/esm/src/types/remoteMethods.d.ts.map +0 -1
- package/.dist/esm/src/types/remoteMethods.js.map +0 -1
- package/index.ts +0 -29
- package/src/aot/aotCacheLoader.ts +0 -15
- package/src/callContext.ts +0 -193
- package/src/constants.ts +0 -45
- package/src/defaultRoutes.ts +0 -37
- package/src/dispatch.ts +0 -204
- package/src/lib/aotEmitter.ts +0 -140
- package/src/lib/dispatchError.ts +0 -60
- package/src/lib/handlers.ts +0 -75
- package/src/lib/headers.ts +0 -102
- package/src/lib/methodsCache.ts +0 -72
- package/src/lib/queryBody.ts +0 -40
- package/src/lib/reflection.ts +0 -517
- package/src/lib/remoteMethods.ts +0 -180
- package/src/lib/test/aotEmitter-test-router.ts +0 -40
- package/src/router.ts +0 -656
- package/src/routes/client.routes.ts +0 -108
- package/src/routes/errors.routes.ts +0 -51
- package/src/routes/mion.routes.ts +0 -11
- package/src/routes/serializer.routes.ts +0 -225
- package/src/routesFlow.ts +0 -320
- package/src/types/context.ts +0 -119
- package/src/types/definitions.ts +0 -53
- package/src/types/general.ts +0 -84
- package/src/types/guards.ts +0 -71
- package/src/types/handlers.ts +0 -49
- package/src/types/publicMethods.ts +0 -83
- package/src/types/remoteMethods.ts +0 -54
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _mionjs_core = require("@mionjs/core");
|
|
3
|
+
//#region src/lib/bodyLimit.ts
|
|
4
|
+
/** Floor of a derived chain limit: a body of `{}` / `[]`, whitespace, or a no-params slot is never refused. */
|
|
5
|
+
var MIN_CHAIN_BODY_SIZE = 64;
|
|
6
|
+
/** A member's contribution: its own `maxBodySize` option, else the compact-JSON maximum of its params
|
|
7
|
+
* tuple the build computed, else unknown. One with no params and no option costs no slot at all. */
|
|
8
|
+
function memberBodyBytes(method) {
|
|
9
|
+
if (method.type === _mionjs_core.HandlerType.rawMiddleware) return null;
|
|
10
|
+
const declared = method.options.maxBodySize;
|
|
11
|
+
if (declared !== void 0) return declared;
|
|
12
|
+
if (!method.paramsCount) return null;
|
|
13
|
+
return method.paramsJsonMaxBytes;
|
|
14
|
+
}
|
|
15
|
+
/** The request limit of one chain, settled once at registration: the route's own `maxBodySize` option,
|
|
16
|
+
* else, when every member with params has a number, the largest keyed body `{"<id>":<params>,…}` times
|
|
17
|
+
* `maxBodySizeFactor`, else undefined, meaning the types cannot say and the request takes the adapter's
|
|
18
|
+
* `maxBodySize` at resolve time. Reads `options.maxBodySize` BEFORE it is overwritten with the result. */
|
|
19
|
+
function resolveChainMaxBodySize(methods, route, opts) {
|
|
20
|
+
if (route.options.maxBodySize !== void 0) return route.options.maxBodySize;
|
|
21
|
+
let total = 2;
|
|
22
|
+
let slots = 0;
|
|
23
|
+
for (const method of methods) {
|
|
24
|
+
const bytes = memberBodyBytes(method);
|
|
25
|
+
if (bytes === null) continue;
|
|
26
|
+
if (bytes === void 0) return void 0;
|
|
27
|
+
total += method.quotedId.length + 1 + bytes;
|
|
28
|
+
slots++;
|
|
29
|
+
}
|
|
30
|
+
if (slots > 1) total += slots - 1;
|
|
31
|
+
return Math.max(Math.ceil(total * opts.maxBodySizeFactor), 64);
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
exports.MIN_CHAIN_BODY_SIZE = MIN_CHAIN_BODY_SIZE;
|
|
35
|
+
exports.resolveChainMaxBodySize = resolveChainMaxBodySize;
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=bodyLimit.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodyLimit.cjs","names":[],"sources":["../../../../src/lib/bodyLimit.ts"],"sourcesContent":["/* ########\n * 2026 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {HandlerType} from '@mionjs/core';\nimport type {RemoteMethod, RouteMethod} from '../types/remoteMethods.ts';\nimport type {RouterOptions} from '../types/general.ts';\n\n/** Floor of a derived chain limit: a body of `{}` / `[]`, whitespace, or a no-params slot is never refused. */\nexport const MIN_CHAIN_BODY_SIZE = 64;\n\n/** A member's contribution: its own `maxBodySize` option, else the compact-JSON maximum of its params\n * tuple the build computed, else unknown. One with no params and no option costs no slot at all. */\nfunction memberBodyBytes(method: RemoteMethod): number | undefined | null {\n if (method.type === HandlerType.rawMiddleware) return null;\n const declared = method.options.maxBodySize;\n if (declared !== undefined) return declared;\n if (!method.paramsCount) return null;\n return method.paramsJsonMaxBytes;\n}\n\n/** The request limit of one chain, settled once at registration: the route's own `maxBodySize` option,\n * else, when every member with params has a number, the largest keyed body `{\"<id>\":<params>,…}` times\n * `maxBodySizeFactor`, else undefined, meaning the types cannot say and the request takes the adapter's\n * `maxBodySize` at resolve time. Reads `options.maxBodySize` BEFORE it is overwritten with the result. */\nexport function resolveChainMaxBodySize(methods: RemoteMethod[], route: RouteMethod, opts: RouterOptions): number | undefined {\n if (route.options.maxBodySize !== undefined) return route.options.maxBodySize;\n let total = 2; // the braces\n let slots = 0;\n for (const method of methods) {\n const bytes = memberBodyBytes(method);\n if (bytes === null) continue;\n if (bytes === undefined) return undefined;\n total += method.quotedId.length + 1 + bytes; // `\"id\":` + params\n slots++;\n }\n if (slots > 1) total += slots - 1; // the commas\n return Math.max(Math.ceil(total * opts.maxBodySizeFactor), MIN_CHAIN_BODY_SIZE);\n}\n"],"mappings":";;;;AAYA,IAAa,sBAAsB;;;AAInC,SAAS,gBAAgB,QAAiD;CACxE,IAAI,OAAO,SAAS,aAAA,YAAY,eAAe,OAAO;CACtD,MAAM,WAAW,OAAO,QAAQ;CAChC,IAAI,aAAa,KAAA,GAAW,OAAO;CACnC,IAAI,CAAC,OAAO,aAAa,OAAO;CAChC,OAAO,OAAO;AAChB;;;;;AAMA,SAAgB,wBAAwB,SAAyB,OAAoB,MAAyC;CAC5H,IAAI,MAAM,QAAQ,gBAAgB,KAAA,GAAW,OAAO,MAAM,QAAQ;CAClE,IAAI,QAAQ;CACZ,IAAI,QAAQ;CACZ,KAAK,MAAM,UAAU,SAAS;EAC5B,MAAM,QAAQ,gBAAgB,MAAM;EACpC,IAAI,UAAU,MAAM;EACpB,IAAI,UAAU,KAAA,GAAW,OAAO,KAAA;EAChC,SAAS,OAAO,SAAS,SAAS,IAAI;EACtC;CACF;CACA,IAAI,QAAQ,GAAG,SAAS,QAAQ;CAChC,OAAO,KAAK,IAAI,KAAK,KAAK,QAAQ,KAAK,iBAAiB,GAAA,EAAsB;AAChF"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RemoteMethod, RouteMethod } from '../types/remoteMethods.ts';
|
|
2
|
+
import { RouterOptions } from '../types/general.ts';
|
|
3
|
+
export declare const MIN_CHAIN_BODY_SIZE = 64;
|
|
4
|
+
export declare function resolveChainMaxBodySize(methods: RemoteMethod[], route: RouteMethod, opts: RouterOptions): number | undefined;
|
|
5
|
+
//# sourceMappingURL=bodyLimit.d.ts.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
let _mionjs_core = require("@mionjs/core");
|
|
3
|
+
//#region src/lib/bodyReader.ts
|
|
4
|
+
/** The 413 a platform adapter answers when a body passes the route's limit while it arrives. */
|
|
5
|
+
function requestPayloadTooLarge() {
|
|
6
|
+
return new _mionjs_core.FatalError({
|
|
7
|
+
statusCode: _mionjs_core.StatusCodes.PAYLOAD_TOO_LARGE,
|
|
8
|
+
publicMessage: "Payload Too Large",
|
|
9
|
+
type: "request-payload-too-large"
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/** How a fetch-style runtime reads a body fastest, a numeric code so the per-request check is one integer
|
|
13
|
+
* compare. Measured on each runtime with a real server:
|
|
14
|
+
* `stream` pulls the body stream and decodes once: node's Request (undici, the vercel node runtime), where
|
|
15
|
+
* `text()` is slower than its own stream at every size.
|
|
16
|
+
* `text` is `text()` when a content-length is declared, the stream otherwise: workerd, where both are
|
|
17
|
+
* native and only the stream can stop an upload mid-flight.
|
|
18
|
+
* `buffered` is `text()` or `arrayBuffer()`, never the stream reader: bun buffers the body natively and its
|
|
19
|
+
* stream reader is over ten times slower, so its server-wide native limit is the one mid-flight guard. */
|
|
20
|
+
var BodyReadStrategy = {
|
|
21
|
+
stream: 1,
|
|
22
|
+
text: 2,
|
|
23
|
+
buffered: 3
|
|
24
|
+
};
|
|
25
|
+
var utf8 = new TextDecoder();
|
|
26
|
+
/** Reads a fetch-style request body as text against the route's limit, the way the runtime reads fastest
|
|
27
|
+
* (`strategy`). A declared `content-length` past the limit is refused before a byte is read. Sizes are
|
|
28
|
+
* counted in bytes, never less than the character count the router checks again before parsing, so the
|
|
29
|
+
* byte-exact refusal here always fires first. Undefined for a request with no body, else the router's 413. */
|
|
30
|
+
async function readRequestBody(req, maxBodySize, strategy) {
|
|
31
|
+
if (!req.body) return void 0;
|
|
32
|
+
const declared = req.headers.get("content-length");
|
|
33
|
+
if (declared !== null) {
|
|
34
|
+
if (Number(declared) > maxBodySize) throw requestPayloadTooLarge();
|
|
35
|
+
if (strategy !== BodyReadStrategy.stream) return req.text();
|
|
36
|
+
return readStream(req, maxBodySize);
|
|
37
|
+
}
|
|
38
|
+
if (strategy !== BodyReadStrategy.buffered) return readStream(req, maxBodySize);
|
|
39
|
+
const bytes = await req.arrayBuffer();
|
|
40
|
+
if (bytes.byteLength > maxBodySize) throw requestPayloadTooLarge();
|
|
41
|
+
return utf8.decode(bytes);
|
|
42
|
+
}
|
|
43
|
+
/** Pulls the body chunk by chunk with the running size counted, cancels the stream the moment it
|
|
44
|
+
* passes the limit so the rest is never pulled, and decodes ONCE at the end. */
|
|
45
|
+
async function readStream(req, maxBodySize) {
|
|
46
|
+
const reader = req.body.getReader();
|
|
47
|
+
const chunks = [];
|
|
48
|
+
let size = 0;
|
|
49
|
+
for (;;) {
|
|
50
|
+
const { done, value } = await reader.read();
|
|
51
|
+
if (done) break;
|
|
52
|
+
size += value.byteLength;
|
|
53
|
+
if (size > maxBodySize) {
|
|
54
|
+
await reader.cancel();
|
|
55
|
+
throw requestPayloadTooLarge();
|
|
56
|
+
}
|
|
57
|
+
chunks.push(value);
|
|
58
|
+
}
|
|
59
|
+
return decodeOnce(chunks, size);
|
|
60
|
+
}
|
|
61
|
+
/** One UTF-8 decode over the whole body: a single chunk decodes in place, several are joined into
|
|
62
|
+
* one buffer first so a character split across chunks is never decoded in halves. */
|
|
63
|
+
function decodeOnce(chunks, size) {
|
|
64
|
+
if (chunks.length === 0) return "";
|
|
65
|
+
if (chunks.length === 1) return utf8.decode(chunks[0]);
|
|
66
|
+
const joined = new Uint8Array(size);
|
|
67
|
+
let offset = 0;
|
|
68
|
+
for (const chunk of chunks) {
|
|
69
|
+
joined.set(chunk, offset);
|
|
70
|
+
offset += chunk.byteLength;
|
|
71
|
+
}
|
|
72
|
+
return utf8.decode(joined);
|
|
73
|
+
}
|
|
74
|
+
//#endregion
|
|
75
|
+
exports.BodyReadStrategy = BodyReadStrategy;
|
|
76
|
+
exports.readRequestBody = readRequestBody;
|
|
77
|
+
exports.requestPayloadTooLarge = requestPayloadTooLarge;
|
|
78
|
+
|
|
79
|
+
//# sourceMappingURL=bodyReader.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bodyReader.cjs","names":[],"sources":["../../../../src/lib/bodyReader.ts"],"sourcesContent":["/* ########\n * 2026 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {FatalError, RpcError, StatusCodes} from '@mionjs/core';\n\n/** The 413 a platform adapter answers when a body passes the route's limit while it arrives. */\nexport function requestPayloadTooLarge(): RpcError<'request-payload-too-large'> {\n return new FatalError({\n statusCode: StatusCodes.PAYLOAD_TOO_LARGE,\n publicMessage: 'Payload Too Large',\n type: 'request-payload-too-large',\n });\n}\n\n/** How a fetch-style runtime reads a body fastest, a numeric code so the per-request check is one integer\n * compare. Measured on each runtime with a real server:\n * `stream` pulls the body stream and decodes once: node's Request (undici, the vercel node runtime), where\n * `text()` is slower than its own stream at every size.\n * `text` is `text()` when a content-length is declared, the stream otherwise: workerd, where both are\n * native and only the stream can stop an upload mid-flight.\n * `buffered` is `text()` or `arrayBuffer()`, never the stream reader: bun buffers the body natively and its\n * stream reader is over ten times slower, so its server-wide native limit is the one mid-flight guard. */\nexport const BodyReadStrategy = {stream: 1, text: 2, buffered: 3} as const;\nexport type BodyReadStrategy = (typeof BodyReadStrategy)[keyof typeof BodyReadStrategy];\n\n// One decoder for every request: a non-streaming `decode` keeps no state between calls, so sharing it is\n// safe. A streaming decode (`{stream: true}`) would not be, which is why the stream path decodes ONCE.\nconst utf8 = new TextDecoder();\n\n/** Reads a fetch-style request body as text against the route's limit, the way the runtime reads fastest\n * (`strategy`). A declared `content-length` past the limit is refused before a byte is read. Sizes are\n * counted in bytes, never less than the character count the router checks again before parsing, so the\n * byte-exact refusal here always fires first. Undefined for a request with no body, else the router's 413. */\nexport async function readRequestBody(\n req: Request,\n maxBodySize: number,\n strategy: BodyReadStrategy\n): Promise<string | undefined> {\n if (!req.body) return undefined;\n const declared = req.headers.get('content-length');\n if (declared !== null) {\n if (Number(declared) > maxBodySize) throw requestPayloadTooLarge();\n // the runtime delivers exactly content-length bytes: one native decode\n if (strategy !== BodyReadStrategy.stream) return req.text();\n return readStream(req, maxBodySize);\n }\n if (strategy !== BodyReadStrategy.buffered) return readStream(req, maxBodySize);\n // no content-length on a runtime whose stream reader is the slow path: take the bytes whole\n // (the native server limit already bounded them) and refuse past the limit before decoding\n const bytes = await req.arrayBuffer();\n if (bytes.byteLength > maxBodySize) throw requestPayloadTooLarge();\n return utf8.decode(bytes);\n}\n\n/** Pulls the body chunk by chunk with the running size counted, cancels the stream the moment it\n * passes the limit so the rest is never pulled, and decodes ONCE at the end. */\nasync function readStream(req: Request, maxBodySize: number): Promise<string> {\n const reader = req.body!.getReader();\n const chunks: Uint8Array[] = [];\n let size = 0;\n for (;;) {\n const {done, value} = await reader.read();\n if (done) break;\n size += value.byteLength;\n if (size > maxBodySize) {\n await reader.cancel();\n throw requestPayloadTooLarge();\n }\n chunks.push(value);\n }\n return decodeOnce(chunks, size);\n}\n\n/** One UTF-8 decode over the whole body: a single chunk decodes in place, several are joined into\n * one buffer first so a character split across chunks is never decoded in halves. */\nfunction decodeOnce(chunks: Uint8Array[], size: number): string {\n if (chunks.length === 0) return '';\n if (chunks.length === 1) return utf8.decode(chunks[0]);\n const joined = new Uint8Array(size);\n let offset = 0;\n for (const chunk of chunks) {\n joined.set(chunk, offset);\n offset += chunk.byteLength;\n }\n return utf8.decode(joined);\n}\n"],"mappings":";;;;AAUA,SAAgB,yBAAgE;CAC9E,OAAO,IAAI,aAAA,WAAW;EACpB,YAAY,aAAA,YAAY;EACxB,eAAe;EACf,MAAM;CACR,CAAC;AACH;;;;;;;;;AAUA,IAAa,mBAAmB;CAAC,QAAQ;CAAG,MAAM;CAAG,UAAU;AAAC;AAKhE,IAAM,OAAO,IAAI,YAAY;;;;;AAM7B,eAAsB,gBACpB,KACA,aACA,UAC6B;CAC7B,IAAI,CAAC,IAAI,MAAM,OAAO,KAAA;CACtB,MAAM,WAAW,IAAI,QAAQ,IAAI,gBAAgB;CACjD,IAAI,aAAa,MAAM;EACrB,IAAI,OAAO,QAAQ,IAAI,aAAa,MAAM,uBAAuB;EAEjE,IAAI,aAAa,iBAAiB,QAAQ,OAAO,IAAI,KAAK;EAC1D,OAAO,WAAW,KAAK,WAAW;CACpC;CACA,IAAI,aAAa,iBAAiB,UAAU,OAAO,WAAW,KAAK,WAAW;CAG9E,MAAM,QAAQ,MAAM,IAAI,YAAY;CACpC,IAAI,MAAM,aAAa,aAAa,MAAM,uBAAuB;CACjE,OAAO,KAAK,OAAO,KAAK;AAC1B;;;AAIA,eAAe,WAAW,KAAc,aAAsC;CAC5E,MAAM,SAAS,IAAI,KAAM,UAAU;CACnC,MAAM,SAAuB,CAAC;CAC9B,IAAI,OAAO;CACX,SAAS;EACP,MAAM,EAAC,MAAM,UAAS,MAAM,OAAO,KAAK;EACxC,IAAI,MAAM;EACV,QAAQ,MAAM;EACd,IAAI,OAAO,aAAa;GACtB,MAAM,OAAO,OAAO;GACpB,MAAM,uBAAuB;EAC/B;EACA,OAAO,KAAK,KAAK;CACnB;CACA,OAAO,WAAW,QAAQ,IAAI;AAChC;;;AAIA,SAAS,WAAW,QAAsB,MAAsB;CAC9D,IAAI,OAAO,WAAW,GAAG,OAAO;CAChC,IAAI,OAAO,WAAW,GAAG,OAAO,KAAK,OAAO,OAAO,EAAE;CACrD,MAAM,SAAS,IAAI,WAAW,IAAI;CAClC,IAAI,SAAS;CACb,KAAK,MAAM,SAAS,QAAQ;EAC1B,OAAO,IAAI,OAAO,MAAM;EACxB,UAAU,MAAM;CAClB;CACA,OAAO,KAAK,OAAO,MAAM;AAC3B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RpcError } from '@mionjs/core';
|
|
2
|
+
export declare function requestPayloadTooLarge(): RpcError<'request-payload-too-large'>;
|
|
3
|
+
export declare const BodyReadStrategy: {
|
|
4
|
+
readonly stream: 1;
|
|
5
|
+
readonly text: 2;
|
|
6
|
+
readonly buffered: 3;
|
|
7
|
+
};
|
|
8
|
+
export type BodyReadStrategy = (typeof BodyReadStrategy)[keyof typeof BodyReadStrategy];
|
|
9
|
+
export declare function readRequestBody(req: Request, maxBodySize: number, strategy: BodyReadStrategy): Promise<string | undefined>;
|
|
10
|
+
//# sourceMappingURL=bodyReader.d.ts.map
|
|
@@ -1,39 +1,82 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
2
|
+
const require_src_constants = require("../constants.cjs");
|
|
3
|
+
let _mionjs_core = require("@mionjs/core");
|
|
4
|
+
//#region src/lib/dispatchError.ts
|
|
5
|
+
/** The response for an error raised outside the router by any adapter; it goes in `@thrownErrors` like a route error. */
|
|
4
6
|
function getRouterFatalErrorResponse(returnErr, respHeaders) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
serializer: core.SerializerModes.json
|
|
17
|
-
// global errors are always json
|
|
18
|
-
};
|
|
19
|
-
return response;
|
|
7
|
+
(0, _mionjs_core.markFatal)(returnErr);
|
|
8
|
+
const body = { "@thrownErrors": { [_mionjs_core.MION_ROUTES.platformError]: returnErr } };
|
|
9
|
+
respHeaders.set("x-rpc-error", errorHeaderValue(returnErr.type));
|
|
10
|
+
return {
|
|
11
|
+
statusCode: returnErr.statusCode || _mionjs_core.StatusCodes.SERVER_ERROR,
|
|
12
|
+
contentType: require_src_constants.JSON_CONTENT_TYPE,
|
|
13
|
+
hasErrors: true,
|
|
14
|
+
fatalError: returnErr,
|
|
15
|
+
headers: respHeaders,
|
|
16
|
+
body
|
|
17
|
+
};
|
|
20
18
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
originalError: err,
|
|
28
|
-
type: "unknown-error"
|
|
29
|
-
});
|
|
30
|
-
if (!response.hasErrors) response.headers.set("x-rpc-error", rpcError.type);
|
|
31
|
-
response.statusCode = rpcError.statusCode ?? core.StatusCodes.UNEXPECTED_ERROR;
|
|
32
|
-
response.hasErrors = true;
|
|
33
|
-
const thrownErrors = context.request.thrownErrors || {};
|
|
34
|
-
thrownErrors[path] = rpcError;
|
|
35
|
-
context.request.thrownErrors = thrownErrors;
|
|
19
|
+
/** An app-thrown RpcError may carry any string as its `type`, and a CR or LF there is header injection on
|
|
20
|
+
* adapters that write headers unchecked (or an ERR_INVALID_CHAR throw on node). Anything outside the token
|
|
21
|
+
* alphabet reports as `unknown-error` on the header; the body still carries the full type. */
|
|
22
|
+
var HEADER_SAFE_TYPE = /^[A-Za-z0-9_.:@-]{1,128}$/;
|
|
23
|
+
function errorHeaderValue(type) {
|
|
24
|
+
return HEADER_SAFE_TYPE.test(type) ? type : "unknown-error";
|
|
36
25
|
}
|
|
26
|
+
/** Marks the response as ended by `rpcError`: the error header (first error only), the status code,
|
|
27
|
+
* `hasErrors` (what the dispatcher's skip rule reads) and `fatalError` (first one wins). Shared by the
|
|
28
|
+
* thrown path and a returned FatalError; where the error itself lands is the caller's decision.
|
|
29
|
+
* `fallbackStatus` answers when the error carries no statusCode: a thrown one is unexpected (422), a
|
|
30
|
+
* returned FatalError a declared application error (400). */
|
|
31
|
+
function markResponseFailed(context, rpcError, fallbackStatus) {
|
|
32
|
+
const response = context.response;
|
|
33
|
+
if (!response.hasErrors) {
|
|
34
|
+
response.headers.set("x-rpc-error", errorHeaderValue(rpcError.type));
|
|
35
|
+
response.fatalError = rpcError;
|
|
36
|
+
}
|
|
37
|
+
response.statusCode = rpcError.statusCode ?? fallbackStatus;
|
|
38
|
+
response.hasErrors = true;
|
|
39
|
+
}
|
|
40
|
+
/** Whatever an adapter caught, as the mion error the wire carries. */
|
|
41
|
+
function toRpcError(err) {
|
|
42
|
+
return err instanceof _mionjs_core.RpcError ? err : new _mionjs_core.FatalError({
|
|
43
|
+
publicMessage: "Unknown Error",
|
|
44
|
+
type: "unknown-error",
|
|
45
|
+
originalError: err
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/** Records an undeclared error under `key` and ends the request: it lands in `@thrownErrors` untyped, sets
|
|
49
|
+
* the status and the error header, and stops every later member that does not declare `alwaysRun`.
|
|
50
|
+
* Undeclared means thrown, or returned by a raw middleware, which cannot declare a return type; a declared
|
|
51
|
+
* error is returned from a handler and goes straight into `response.body`. The key is normally the member
|
|
52
|
+
* that failed; an adapter passes its own (`mion@platformError`) for a request no member could run. */
|
|
53
|
+
function recordUndeclaredError(context, key, err) {
|
|
54
|
+
const rpcError = (0, _mionjs_core.markFatal)(err instanceof _mionjs_core.RpcError ? err : new _mionjs_core.FatalError({
|
|
55
|
+
statusCode: _mionjs_core.StatusCodes.UNEXPECTED_ERROR,
|
|
56
|
+
publicMessage: `Unknown error in handler "${key}" of route ExecutionChain.`,
|
|
57
|
+
originalError: err,
|
|
58
|
+
type: "unknown-error"
|
|
59
|
+
}));
|
|
60
|
+
markResponseFailed(context, rpcError, _mionjs_core.StatusCodes.UNEXPECTED_ERROR);
|
|
61
|
+
addThrownError(context, key, rpcError);
|
|
62
|
+
}
|
|
63
|
+
/** Unlike recordUndeclaredError, does not end the request. */
|
|
64
|
+
function addThrownError(context, key, rpcError) {
|
|
65
|
+
const thrownErrors = context.request.thrownErrors || {};
|
|
66
|
+
thrownErrors[key] = rpcError;
|
|
67
|
+
context.request.thrownErrors = thrownErrors;
|
|
68
|
+
}
|
|
69
|
+
function hasThrownError(context, key) {
|
|
70
|
+
const thrownErrors = context.request.thrownErrors;
|
|
71
|
+
return !!thrownErrors && Object.hasOwn(thrownErrors, key);
|
|
72
|
+
}
|
|
73
|
+
//#endregion
|
|
74
|
+
exports.addThrownError = addThrownError;
|
|
75
|
+
exports.errorHeaderValue = errorHeaderValue;
|
|
37
76
|
exports.getRouterFatalErrorResponse = getRouterFatalErrorResponse;
|
|
38
|
-
exports.
|
|
39
|
-
|
|
77
|
+
exports.hasThrownError = hasThrownError;
|
|
78
|
+
exports.markResponseFailed = markResponseFailed;
|
|
79
|
+
exports.recordUndeclaredError = recordUndeclaredError;
|
|
80
|
+
exports.toRpcError = toRpcError;
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=dispatchError.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatchError.cjs","sources":["../../../../src/lib/dispatchError.ts"],"sourcesContent":["import {RpcError, MION_ROUTES, Mutable, StatusCodes,
|
|
1
|
+
{"version":3,"file":"dispatchError.cjs","names":[],"sources":["../../../../src/lib/dispatchError.ts"],"sourcesContent":["import {RpcError, FatalError, MION_ROUTES, Mutable, StatusCodes, markFatal} from '@mionjs/core';\nimport {JSON_CONTENT_TYPE} from '../constants.ts';\nimport type {CallContext, MionHeaders, MionRequest, MionResponse, ResponseBody} from '../types/context.ts';\n\n/** The response for an error raised outside the router by any adapter; it goes in `@thrownErrors` like a route error. */\n\nexport function getRouterFatalErrorResponse(returnErr: RpcError<string>, respHeaders: MionHeaders): MionResponse {\n // a platform error ends the request before any handler runs, so it is fatal by definition\n markFatal(returnErr);\n const body: ResponseBody = {\n '@thrownErrors': {[MION_ROUTES.platformError]: returnErr},\n };\n respHeaders.set('x-rpc-error', errorHeaderValue(returnErr.type));\n const response: Mutable<MionResponse> = {\n statusCode: returnErr.statusCode || StatusCodes.SERVER_ERROR, // Global errors are always unexpected\n contentType: JSON_CONTENT_TYPE,\n hasErrors: true,\n fatalError: returnErr,\n headers: respHeaders,\n body,\n };\n return response;\n}\n\n/** An app-thrown RpcError may carry any string as its `type`, and a CR or LF there is header injection on\n * adapters that write headers unchecked (or an ERR_INVALID_CHAR throw on node). Anything outside the token\n * alphabet reports as `unknown-error` on the header; the body still carries the full type. */\nconst HEADER_SAFE_TYPE = /^[A-Za-z0-9_.:@-]{1,128}$/;\nexport function errorHeaderValue(type: string): string {\n return HEADER_SAFE_TYPE.test(type) ? type : 'unknown-error';\n}\n\n/** Marks the response as ended by `rpcError`: the error header (first error only), the status code,\n * `hasErrors` (what the dispatcher's skip rule reads) and `fatalError` (first one wins). Shared by the\n * thrown path and a returned FatalError; where the error itself lands is the caller's decision.\n * `fallbackStatus` answers when the error carries no statusCode: a thrown one is unexpected (422), a\n * returned FatalError a declared application error (400). */\nexport function markResponseFailed(context: CallContext, rpcError: RpcError<string>, fallbackStatus: number) {\n const response = context.response as Mutable<MionResponse>;\n if (!response.hasErrors) {\n response.headers.set('x-rpc-error', errorHeaderValue(rpcError.type));\n response.fatalError = rpcError;\n }\n response.statusCode = rpcError.statusCode ?? fallbackStatus;\n response.hasErrors = true;\n}\n\n/** Whatever an adapter caught, as the mion error the wire carries. */\nexport function toRpcError(err: unknown): RpcError<string> {\n return err instanceof RpcError\n ? err\n : new FatalError({publicMessage: 'Unknown Error', type: 'unknown-error', originalError: err as Error});\n}\n\n/** Records an undeclared error under `key` and ends the request: it lands in `@thrownErrors` untyped, sets\n * the status and the error header, and stops every later member that does not declare `alwaysRun`.\n * Undeclared means thrown, or returned by a raw middleware, which cannot declare a return type; a declared\n * error is returned from a handler and goes straight into `response.body`. The key is normally the member\n * that failed; an adapter passes its own (`mion@platformError`) for a request no member could run. */\nexport function recordUndeclaredError(context: CallContext, key: string, err: any) {\n const rpcError: RpcError<string> = markFatal(\n err instanceof RpcError\n ? err\n : new FatalError({\n statusCode: StatusCodes.UNEXPECTED_ERROR,\n publicMessage: `Unknown error in handler \"${key}\" of route ExecutionChain.`,\n originalError: err,\n type: 'unknown-error',\n })\n );\n markResponseFailed(context, rpcError, StatusCodes.UNEXPECTED_ERROR);\n addThrownError(context, key, rpcError);\n}\n\n/** Unlike recordUndeclaredError, does not end the request. */\nexport function addThrownError(context: CallContext, key: string, rpcError: RpcError<string>) {\n // tsgo types `readonly || mutable` as readonly, so casting only the `{}` fallback still forbids the write.\n const thrownErrors = (context.request.thrownErrors || {}) as Record<string, RpcError<string>>;\n thrownErrors[key] = rpcError;\n (context.request as Mutable<MionRequest>).thrownErrors = thrownErrors;\n}\n\nexport function hasThrownError(context: CallContext, key: string): boolean {\n const thrownErrors = context.request.thrownErrors;\n return !!thrownErrors && Object.hasOwn(thrownErrors, key);\n}\n"],"mappings":";;;;;AAMA,SAAgB,4BAA4B,WAA6B,aAAwC;CAE/G,CAAA,GAAA,aAAA,WAAU,SAAS;CACnB,MAAM,OAAqB,EACzB,iBAAiB,GAAE,aAAA,YAAY,gBAAgB,UAAS,EAC1D;CACA,YAAY,IAAI,eAAe,iBAAiB,UAAU,IAAI,CAAC;CAS/D,OAAO;EAPL,YAAY,UAAU,cAAc,aAAA,YAAY;EAChD,aAAa,sBAAA;EACb,WAAW;EACX,YAAY;EACZ,SAAS;EACT;CAEK;AACT;;;;AAKA,IAAM,mBAAmB;AACzB,SAAgB,iBAAiB,MAAsB;CACrD,OAAO,iBAAiB,KAAK,IAAI,IAAI,OAAO;AAC9C;;;;;;AAOA,SAAgB,mBAAmB,SAAsB,UAA4B,gBAAwB;CAC3G,MAAM,WAAW,QAAQ;CACzB,IAAI,CAAC,SAAS,WAAW;EACvB,SAAS,QAAQ,IAAI,eAAe,iBAAiB,SAAS,IAAI,CAAC;EACnE,SAAS,aAAa;CACxB;CACA,SAAS,aAAa,SAAS,cAAc;CAC7C,SAAS,YAAY;AACvB;;AAGA,SAAgB,WAAW,KAAgC;CACzD,OAAO,eAAe,aAAA,WAClB,MACA,IAAI,aAAA,WAAW;EAAC,eAAe;EAAiB,MAAM;EAAiB,eAAe;CAAY,CAAC;AACzG;;;;;;AAOA,SAAgB,sBAAsB,SAAsB,KAAa,KAAU;CACjF,MAAM,YAAA,GAAA,aAAA,WACJ,eAAe,aAAA,WACX,MACA,IAAI,aAAA,WAAW;EACb,YAAY,aAAA,YAAY;EACxB,eAAe,6BAA6B,IAAI;EAChD,eAAe;EACf,MAAM;CACR,CAAC,CACP;CACA,mBAAmB,SAAS,UAAU,aAAA,YAAY,gBAAgB;CAClE,eAAe,SAAS,KAAK,QAAQ;AACvC;;AAGA,SAAgB,eAAe,SAAsB,KAAa,UAA4B;CAE5F,MAAM,eAAgB,QAAQ,QAAQ,gBAAgB,CAAC;CACvD,aAAa,OAAO;CACpB,QAAS,QAAiC,eAAe;AAC3D;AAEA,SAAgB,eAAe,SAAsB,KAAsB;CACzE,MAAM,eAAe,QAAQ,QAAQ;CACrC,OAAO,CAAC,CAAC,gBAAgB,OAAO,OAAO,cAAc,GAAG;AAC1D"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { RpcError } from '@mionjs/core';
|
|
2
2
|
import { CallContext, MionHeaders, MionResponse } from '../types/context.ts';
|
|
3
|
-
import { RemoteMethod } from '../types/remoteMethods.ts';
|
|
4
3
|
export declare function getRouterFatalErrorResponse(returnErr: RpcError<string>, respHeaders: MionHeaders): MionResponse;
|
|
5
|
-
export declare function
|
|
4
|
+
export declare function errorHeaderValue(type: string): string;
|
|
5
|
+
export declare function markResponseFailed(context: CallContext, rpcError: RpcError<string>, fallbackStatus: number): void;
|
|
6
|
+
export declare function toRpcError(err: unknown): RpcError<string>;
|
|
7
|
+
export declare function recordUndeclaredError(context: CallContext, key: string, err: any): void;
|
|
8
|
+
export declare function addThrownError(context: CallContext, key: string, rpcError: RpcError<string>): void;
|
|
9
|
+
export declare function hasThrownError(context: CallContext, key: string): boolean;
|
|
6
10
|
//# sourceMappingURL=dispatchError.d.ts.map
|
|
@@ -1,52 +1,99 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
let _mionjs_core = require("@mionjs/core");
|
|
3
|
+
//#region src/lib/handlers.ts
|
|
4
|
+
var route = (handler, opts, paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId) => ({
|
|
5
|
+
type: _mionjs_core.HandlerType.route,
|
|
6
|
+
handler,
|
|
7
|
+
options: opts,
|
|
8
|
+
rtFns: {
|
|
9
|
+
paramsFns,
|
|
10
|
+
returnFns,
|
|
11
|
+
paramsId,
|
|
12
|
+
returnId,
|
|
13
|
+
isAsyncId,
|
|
14
|
+
syncId
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
/** Typed as the same helper as `route()`, so both keep the marker signature the scanner reads at the call site. */
|
|
18
|
+
function routeWithMutation(isMutation) {
|
|
19
|
+
return (handler, opts, paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId) => ({
|
|
20
|
+
type: _mionjs_core.HandlerType.route,
|
|
21
|
+
handler,
|
|
22
|
+
options: {
|
|
23
|
+
...opts,
|
|
24
|
+
isMutation
|
|
25
|
+
},
|
|
26
|
+
rtFns: {
|
|
27
|
+
paramsFns,
|
|
28
|
+
returnFns,
|
|
29
|
+
paramsId,
|
|
30
|
+
returnId,
|
|
31
|
+
isAsyncId,
|
|
32
|
+
syncId
|
|
33
|
+
}
|
|
34
|
+
});
|
|
10
35
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
36
|
+
/** Route handler for read-only queries. Uses GET with ?data=base64url on the client when payload fits. */
|
|
37
|
+
var query = routeWithMutation(false);
|
|
38
|
+
var mutation = routeWithMutation(true);
|
|
39
|
+
var middleware = (handler, opts, paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId) => ({
|
|
40
|
+
type: _mionjs_core.HandlerType.middleware,
|
|
41
|
+
handler,
|
|
42
|
+
options: opts,
|
|
43
|
+
rtFns: {
|
|
44
|
+
paramsFns,
|
|
45
|
+
returnFns,
|
|
46
|
+
paramsId,
|
|
47
|
+
returnId,
|
|
48
|
+
isAsyncId,
|
|
49
|
+
syncId
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
var headersMiddleware = (handler, opts, headersFns, paramsFns, returnFns, headersId, paramsId, returnId, isAsyncId, syncId) => ({
|
|
53
|
+
type: _mionjs_core.HandlerType.headersMiddleware,
|
|
54
|
+
handler,
|
|
55
|
+
options: opts,
|
|
56
|
+
rtFns: {
|
|
57
|
+
paramsFns,
|
|
58
|
+
returnFns,
|
|
59
|
+
paramsId,
|
|
60
|
+
returnId,
|
|
61
|
+
isAsyncId,
|
|
62
|
+
syncId,
|
|
63
|
+
headersFns,
|
|
64
|
+
headersId
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
var rawMiddleware = (handler, opts) => ({
|
|
68
|
+
type: _mionjs_core.HandlerType.rawMiddleware,
|
|
69
|
+
handler,
|
|
70
|
+
options: opts
|
|
71
|
+
});
|
|
72
|
+
/** Each on-demand middleware, with what it does on every call even without its slot. */
|
|
73
|
+
var onDemandMiddlewares = /* @__PURE__ */ new WeakMap();
|
|
74
|
+
/** Internal: the middleware runs only when the request body carries its slot, so an absent slot costs nothing */
|
|
75
|
+
function markOnDemand(def, onEveryCall) {
|
|
76
|
+
onDemandMiddlewares.set(def, onEveryCall);
|
|
77
|
+
return def;
|
|
17
78
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
type: core.HandlerType.route,
|
|
21
|
-
handler,
|
|
22
|
-
options: { ...opts, isMutation: true }
|
|
23
|
-
};
|
|
79
|
+
function isOnDemandMiddleware(def) {
|
|
80
|
+
return onDemandMiddlewares.has(def);
|
|
24
81
|
}
|
|
25
|
-
function
|
|
26
|
-
|
|
27
|
-
type: core.HandlerType.middleFn,
|
|
28
|
-
handler,
|
|
29
|
-
options: opts
|
|
30
|
-
};
|
|
82
|
+
function getOnEveryCall(def) {
|
|
83
|
+
return onDemandMiddlewares.get(def);
|
|
31
84
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
type: core.HandlerType.rawMiddleFn,
|
|
42
|
-
handler,
|
|
43
|
-
options: opts
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
exports.headersFn = headersFn;
|
|
47
|
-
exports.middleFn = middleFn;
|
|
85
|
+
/** mion's own ids, never exposed to clients */
|
|
86
|
+
var mionInternalRouteIds = new Set(Object.values(_mionjs_core.MION_ROUTES));
|
|
87
|
+
//#endregion
|
|
88
|
+
exports.getOnEveryCall = getOnEveryCall;
|
|
89
|
+
exports.headersMiddleware = headersMiddleware;
|
|
90
|
+
exports.isOnDemandMiddleware = isOnDemandMiddleware;
|
|
91
|
+
exports.markOnDemand = markOnDemand;
|
|
92
|
+
exports.middleware = middleware;
|
|
93
|
+
exports.mionInternalRouteIds = mionInternalRouteIds;
|
|
48
94
|
exports.mutation = mutation;
|
|
49
95
|
exports.query = query;
|
|
50
|
-
exports.
|
|
96
|
+
exports.rawMiddleware = rawMiddleware;
|
|
51
97
|
exports.route = route;
|
|
52
|
-
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=handlers.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.cjs","sources":["../../../../src/lib/handlers.ts"],"sourcesContent":["/* ########\n * 2024 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {
|
|
1
|
+
{"version":3,"file":"handlers.cjs","names":[],"sources":["../../../../src/lib/handlers.ts"],"sourcesContent":["/* ########\n * 2024 mion\n * Author: Ma-jerez\n * License: MIT\n * The software is provided \"as is\", without warranty of any kind.\n * ######## */\n\nimport {HandlerType, MION_ROUTES} from '@mionjs/core';\nimport type {\n HeadersMiddlewareHelper,\n MiddlewareHelper,\n PinnedMutation,\n RawMiddlewareHelper,\n RouteHelper,\n RouterOptionsInput,\n} from '../types/mionRouter.ts';\nimport type {CallContext} from '../types/context.ts';\n\n// ############# Route & Middlewares initialization (INTERNAL) #############\n// These bodies initialize the definition objects AND are the mion injection points: the trailing marker\n// params are filled at BUILD TIME by @mionjs/devtools. Not exported from the package, consumers reach\n// them as the closures `createMionRouter()` returns; only mion's own middlewares and its error / serializer routes\n// call them directly, each pinning its own `encoder`.\n// ⚠️ There is NO signature here on purpose: each body is TYPED BY its helper interface in\n// types/mionRouter.ts, the one place a helper signature is written, so there is no second surface to keep\n// in step. `RouterOptionsInput` is the widest options shape; `createMionRouter` narrows each helper to\n// its own `O` so a declaration reads the factory's options.\n\nexport const route: RouteHelper<RouterOptionsInput> = (\n handler,\n opts,\n paramsFns,\n returnFns,\n paramsId,\n returnId,\n isAsyncId,\n syncId\n) => ({\n type: HandlerType.route,\n handler,\n options: opts,\n rtFns: {paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId},\n});\n\n/** Typed as the same helper as `route()`, so both keep the marker signature the scanner reads at the call site. */\nfunction routeWithMutation<M extends boolean>(isMutation: M): RouteHelper<RouterOptionsInput, M> {\n return (handler, opts, paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId) => ({\n type: HandlerType.route,\n handler,\n options: {...opts, isMutation} as PinnedMutation<typeof opts & object, M>,\n rtFns: {paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId},\n });\n}\n\n/** Route handler for read-only queries. Uses GET with ?data=base64url on the client when payload fits. */\nexport const query = routeWithMutation(false);\n\nexport const mutation = routeWithMutation(true);\n\nexport const middleware: MiddlewareHelper<RouterOptionsInput> = (\n handler,\n opts,\n paramsFns,\n returnFns,\n paramsId,\n returnId,\n isAsyncId,\n syncId\n) => ({\n type: HandlerType.middleware,\n handler,\n options: opts,\n rtFns: {paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId},\n});\n\nexport const headersMiddleware: HeadersMiddlewareHelper<RouterOptionsInput> = (\n handler,\n opts,\n headersFns,\n paramsFns,\n returnFns,\n headersId,\n paramsId,\n returnId,\n isAsyncId,\n syncId\n) => ({\n type: HandlerType.headersMiddleware,\n handler,\n options: opts,\n rtFns: {paramsFns, returnFns, paramsId, returnId, isAsyncId, syncId, headersFns, headersId},\n});\n\nexport const rawMiddleware: RawMiddlewareHelper<RouterOptionsInput> = (handler, opts) => ({\n type: HandlerType.rawMiddleware,\n handler,\n options: opts,\n});\n\n/** Each on-demand middleware, with what it does on every call even without its slot. */\nconst onDemandMiddlewares = new WeakMap<object, OnEveryCall | undefined>();\ntype OnEveryCall = (ctx: CallContext) => void;\n\n/** Internal: the middleware runs only when the request body carries its slot, so an absent slot costs nothing */\nexport function markOnDemand<Def extends object>(def: Def, onEveryCall?: OnEveryCall): Def {\n onDemandMiddlewares.set(def, onEveryCall);\n return def;\n}\n\nexport function isOnDemandMiddleware(def: object): boolean {\n return onDemandMiddlewares.has(def);\n}\n\nexport function getOnEveryCall(def: object): OnEveryCall | undefined {\n return onDemandMiddlewares.get(def);\n}\n\n/** mion's own ids, never exposed to clients */\nexport const mionInternalRouteIds: ReadonlySet<string> = new Set(Object.values(MION_ROUTES));\n"],"mappings":";;;AA4BA,IAAa,SACX,SACA,MACA,WACA,WACA,UACA,UACA,WACA,YACI;CACJ,MAAM,aAAA,YAAY;CAClB;CACA,SAAS;CACT,OAAO;EAAC;EAAW;EAAW;EAAU;EAAU;EAAW;CAAM;AACrE;;AAGA,SAAS,kBAAqC,YAAmD;CAC/F,QAAQ,SAAS,MAAM,WAAW,WAAW,UAAU,UAAU,WAAW,YAAY;EACtF,MAAM,aAAA,YAAY;EAClB;EACA,SAAS;GAAC,GAAG;GAAM;EAAU;EAC7B,OAAO;GAAC;GAAW;GAAW;GAAU;GAAU;GAAW;EAAM;CACrE;AACF;;AAGA,IAAa,QAAQ,kBAAkB,KAAK;AAE5C,IAAa,WAAW,kBAAkB,IAAI;AAE9C,IAAa,cACX,SACA,MACA,WACA,WACA,UACA,UACA,WACA,YACI;CACJ,MAAM,aAAA,YAAY;CAClB;CACA,SAAS;CACT,OAAO;EAAC;EAAW;EAAW;EAAU;EAAU;EAAW;CAAM;AACrE;AAEA,IAAa,qBACX,SACA,MACA,YACA,WACA,WACA,WACA,UACA,UACA,WACA,YACI;CACJ,MAAM,aAAA,YAAY;CAClB;CACA,SAAS;CACT,OAAO;EAAC;EAAW;EAAW;EAAU;EAAU;EAAW;EAAQ;EAAY;CAAS;AAC5F;AAEA,IAAa,iBAA0D,SAAS,UAAU;CACxF,MAAM,aAAA,YAAY;CAClB;CACA,SAAS;AACX;;AAGA,IAAM,sCAAsB,IAAI,QAAyC;;AAIzE,SAAgB,aAAiC,KAAU,aAAgC;CACzF,oBAAoB,IAAI,KAAK,WAAW;CACxC,OAAO;AACT;AAEA,SAAgB,qBAAqB,KAAsB;CACzD,OAAO,oBAAoB,IAAI,GAAG;AACpC;AAEA,SAAgB,eAAe,KAAsC;CACnE,OAAO,oBAAoB,IAAI,GAAG;AACpC;;AAGA,IAAa,uBAA4C,IAAI,IAAI,OAAO,OAAO,aAAA,WAAW,CAAC"}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
export declare
|
|
5
|
-
export declare
|
|
6
|
-
export declare
|
|
7
|
-
export declare
|
|
8
|
-
export declare
|
|
9
|
-
|
|
1
|
+
import { HeadersMiddlewareHelper, MiddlewareHelper, RawMiddlewareHelper, RouteHelper, RouterOptionsInput } from '../types/mionRouter.ts';
|
|
2
|
+
import { CallContext } from '../types/context.ts';
|
|
3
|
+
export declare const route: RouteHelper<RouterOptionsInput>;
|
|
4
|
+
export declare const query: RouteHelper<Partial<import('../types/general.ts').RouterOptions<any, any>>, false>;
|
|
5
|
+
export declare const mutation: RouteHelper<Partial<import('../types/general.ts').RouterOptions<any, any>>, true>;
|
|
6
|
+
export declare const middleware: MiddlewareHelper<RouterOptionsInput>;
|
|
7
|
+
export declare const headersMiddleware: HeadersMiddlewareHelper<RouterOptionsInput>;
|
|
8
|
+
export declare const rawMiddleware: RawMiddlewareHelper<RouterOptionsInput>;
|
|
9
|
+
type OnEveryCall = (ctx: CallContext) => void;
|
|
10
|
+
export declare function markOnDemand<Def extends object>(def: Def, onEveryCall?: OnEveryCall): Def;
|
|
11
|
+
export declare function isOnDemandMiddleware(def: object): boolean;
|
|
12
|
+
export declare function getOnEveryCall(def: object): OnEveryCall | undefined;
|
|
13
|
+
export declare const mionInternalRouteIds: ReadonlySet<string>;
|
|
14
|
+
export {};
|
|
10
15
|
//# sourceMappingURL=handlers.d.ts.map
|