@geekmidas/constructs 3.0.5 → 3.0.7
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/CHANGELOG.md +12 -0
- package/dist/{AWSLambdaFunction-BF1gJJjG.d.mts → AWSLambdaFunction-CC8gMZhz.d.mts} +3 -3
- package/dist/{AWSLambdaFunction-BF1gJJjG.d.mts.map → AWSLambdaFunction-CC8gMZhz.d.mts.map} +1 -1
- package/dist/{AWSLambdaSubscriberAdaptor-OQvj2lKI.d.mts → AWSLambdaSubscriberAdaptor-Cmx9OQGG.d.mts} +2 -2
- package/dist/{AWSLambdaSubscriberAdaptor-OQvj2lKI.d.mts.map → AWSLambdaSubscriberAdaptor-Cmx9OQGG.d.mts.map} +1 -1
- package/dist/{AmazonApiGatewayEndpointAdaptor-D7mhDtSL.cjs → AmazonApiGatewayEndpointAdaptor-BIltcbAc.cjs} +2 -1
- package/dist/AmazonApiGatewayEndpointAdaptor-BIltcbAc.cjs.map +1 -0
- package/dist/{AmazonApiGatewayEndpointAdaptor-Cmm9d_Po.mjs → AmazonApiGatewayEndpointAdaptor-BpYtYCeW.mjs} +2 -1
- package/dist/AmazonApiGatewayEndpointAdaptor-BpYtYCeW.mjs.map +1 -0
- package/dist/{AmazonApiGatewayEndpointAdaptor-CS-m4WZy.d.mts → AmazonApiGatewayEndpointAdaptor-DA0rS_1Y.d.mts} +4 -4
- package/dist/{AmazonApiGatewayEndpointAdaptor-CS-m4WZy.d.mts.map → AmazonApiGatewayEndpointAdaptor-DA0rS_1Y.d.mts.map} +1 -1
- package/dist/{AmazonApiGatewayEndpointAdaptor-DisDeEF0.d.cts → AmazonApiGatewayEndpointAdaptor-DqNcQGMf.d.cts} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-DisDeEF0.d.cts.map → AmazonApiGatewayEndpointAdaptor-DqNcQGMf.d.cts.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-DSMe7dZ4.d.mts → AmazonApiGatewayV1EndpointAdaptor-C7rJzNvG.d.mts} +4 -4
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-DSMe7dZ4.d.mts.map → AmazonApiGatewayV1EndpointAdaptor-C7rJzNvG.d.mts.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-zrlehWUG.mjs → AmazonApiGatewayV1EndpointAdaptor-CRwyWT6t.mjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-zrlehWUG.mjs.map → AmazonApiGatewayV1EndpointAdaptor-CRwyWT6t.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-DstIoQBv.cjs → AmazonApiGatewayV1EndpointAdaptor-DEETT6Wj.cjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-DstIoQBv.cjs.map → AmazonApiGatewayV1EndpointAdaptor-DEETT6Wj.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-D6wNqjth.d.cts → AmazonApiGatewayV1EndpointAdaptor-DcN2fYsv.d.cts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-D6wNqjth.d.cts.map → AmazonApiGatewayV1EndpointAdaptor-DcN2fYsv.d.cts.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-DaAHSnqs.cjs → AmazonApiGatewayV2EndpointAdaptor-C2qO8FN6.cjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-DaAHSnqs.cjs.map → AmazonApiGatewayV2EndpointAdaptor-C2qO8FN6.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-PcMFUEF9.d.cts → AmazonApiGatewayV2EndpointAdaptor-Cn9UoRgB.d.cts} +3 -3
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-PcMFUEF9.d.cts.map → AmazonApiGatewayV2EndpointAdaptor-Cn9UoRgB.d.cts.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-ByljgCnY.d.mts → AmazonApiGatewayV2EndpointAdaptor-d7NP-bZX.d.mts} +4 -4
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-ByljgCnY.d.mts.map → AmazonApiGatewayV2EndpointAdaptor-d7NP-bZX.d.mts.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-Dj5v-I6S.mjs → AmazonApiGatewayV2EndpointAdaptor-m9YKI294.mjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-Dj5v-I6S.mjs.map → AmazonApiGatewayV2EndpointAdaptor-m9YKI294.mjs.map} +1 -1
- package/dist/{Authorizer-Dx57psuM.cjs → Authorizer-BZ1LcZFt.cjs} +1 -1
- package/dist/{Authorizer-Dx57psuM.cjs.map → Authorizer-BZ1LcZFt.cjs.map} +1 -1
- package/dist/{Authorizer-DBsrDTuf.d.mts → Authorizer-C5_FC_Rq.d.mts} +1 -1
- package/dist/{Authorizer-DBsrDTuf.d.mts.map → Authorizer-C5_FC_Rq.d.mts.map} +1 -1
- package/dist/{Authorizer-4unKN3Xn.mjs → Authorizer-CZpg1Jqk.mjs} +1 -1
- package/dist/{Authorizer-4unKN3Xn.mjs.map → Authorizer-CZpg1Jqk.mjs.map} +1 -1
- package/dist/{BaseFunctionBuilder-CsvFjzA8.d.mts → BaseFunctionBuilder-Q5qIlF-F.d.mts} +2 -2
- package/dist/{BaseFunctionBuilder-CsvFjzA8.d.mts.map → BaseFunctionBuilder-Q5qIlF-F.d.mts.map} +1 -1
- package/dist/{Construct-C2SyofdS.d.mts → Construct-BjpXFNxy.d.mts} +1 -1
- package/dist/{Construct-C2SyofdS.d.mts.map → Construct-BjpXFNxy.d.mts.map} +1 -1
- package/dist/Construct.d.mts +1 -1
- package/dist/{Cron-CWxjO2Fg.d.mts → Cron-BljK1gsV.d.mts} +2 -2
- package/dist/{Cron-BDxW6fYg.d.cts.map → Cron-BljK1gsV.d.mts.map} +1 -1
- package/dist/{Cron-DEKZg5j4.cjs → Cron-C1vyfJ8B.cjs} +1 -1
- package/dist/{Cron-DEKZg5j4.cjs.map → Cron-C1vyfJ8B.cjs.map} +1 -1
- package/dist/{Cron-B3vrGuaD.mjs → Cron-CjWQEad0.mjs} +1 -1
- package/dist/{Cron-B3vrGuaD.mjs.map → Cron-CjWQEad0.mjs.map} +1 -1
- package/dist/{Cron-BDxW6fYg.d.cts → Cron-CllHkk3z.d.cts} +1 -1
- package/dist/{Cron-CWxjO2Fg.d.mts.map → Cron-CllHkk3z.d.cts.map} +1 -1
- package/dist/{CronBuilder-VXpyNfp2.mjs → CronBuilder-CAJFtnmZ.mjs} +2 -2
- package/dist/{CronBuilder-VXpyNfp2.mjs.map → CronBuilder-CAJFtnmZ.mjs.map} +1 -1
- package/dist/{CronBuilder-DJnXbDGK.d.mts → CronBuilder-CG54f9LM.d.mts} +4 -4
- package/dist/{CronBuilder-CginrW3H.d.cts.map → CronBuilder-CG54f9LM.d.mts.map} +1 -1
- package/dist/{CronBuilder-BHpY6w3b.cjs → CronBuilder-CSMd02lu.cjs} +2 -2
- package/dist/{CronBuilder-BHpY6w3b.cjs.map → CronBuilder-CSMd02lu.cjs.map} +1 -1
- package/dist/{CronBuilder-CginrW3H.d.cts → CronBuilder-i23l40xs.d.cts} +2 -2
- package/dist/{CronBuilder-DJnXbDGK.d.mts.map → CronBuilder-i23l40xs.d.cts.map} +1 -1
- package/dist/{Endpoint-BIvS-rKH.d.mts → Endpoint-BET0JSZK.d.mts} +9 -9
- package/dist/Endpoint-BET0JSZK.d.mts.map +1 -0
- package/dist/Endpoint-BcxvF4F3.cjs.map +1 -1
- package/dist/{Endpoint-BPh52sXZ.d.cts → Endpoint-CGdCGJkC.d.cts} +6 -6
- package/dist/Endpoint-CGdCGJkC.d.cts.map +1 -0
- package/dist/Endpoint-DvY3aqAy.mjs.map +1 -1
- package/dist/{EndpointBuilder-3xH8Gllw.d.mts → EndpointBuilder-6kdrQyIh.d.mts} +7 -7
- package/dist/EndpointBuilder-6kdrQyIh.d.mts.map +1 -0
- package/dist/{EndpointBuilder-BmVTFp1A.d.cts → EndpointBuilder-CSwIguiR.d.cts} +4 -4
- package/dist/EndpointBuilder-CSwIguiR.d.cts.map +1 -0
- package/dist/{EndpointBuilder-QdDf3x87.cjs → EndpointBuilder-EptJojG9.cjs} +3 -3
- package/dist/EndpointBuilder-EptJojG9.cjs.map +1 -0
- package/dist/{EndpointBuilder-CMzbGG2c.mjs → EndpointBuilder-iDpnACRb.mjs} +3 -3
- package/dist/EndpointBuilder-iDpnACRb.mjs.map +1 -0
- package/dist/{EndpointFactory-DKHnUYl8.d.mts → EndpointFactory-CBagQW5j.d.mts} +6 -6
- package/dist/EndpointFactory-CBagQW5j.d.mts.map +1 -0
- package/dist/{EndpointFactory-AsfUsn-v.cjs → EndpointFactory-D2QxeaAh.cjs} +3 -3
- package/dist/EndpointFactory-D2QxeaAh.cjs.map +1 -0
- package/dist/{EndpointFactory-DaDXPRAg.d.cts → EndpointFactory-DQYSH8XK.d.cts} +5 -5
- package/dist/EndpointFactory-DQYSH8XK.d.cts.map +1 -0
- package/dist/{EndpointFactory-CkPaFZA0.mjs → EndpointFactory-wgcqWod-.mjs} +3 -3
- package/dist/EndpointFactory-wgcqWod-.mjs.map +1 -0
- package/dist/{Function-CZw1DRQ6.d.mts → Function-D74HrBnX.d.mts} +2 -2
- package/dist/{Function-CZw1DRQ6.d.mts.map → Function-D74HrBnX.d.mts.map} +1 -1
- package/dist/{FunctionBuilder-m5BNA2Ap.d.mts → FunctionBuilder-C_qPxC8g.d.mts} +4 -4
- package/dist/{FunctionBuilder-m5BNA2Ap.d.mts.map → FunctionBuilder-C_qPxC8g.d.mts.map} +1 -1
- package/dist/{FunctionExecutionWrapper-C7yYXIq-.d.mts → FunctionExecutionWrapper-xbTmBARx.d.mts} +2 -2
- package/dist/{FunctionExecutionWrapper-C7yYXIq-.d.mts.map → FunctionExecutionWrapper-xbTmBARx.d.mts.map} +1 -1
- package/dist/{HonoEndpointAdaptor-Jbptyuxv.cjs → HonoEndpointAdaptor-B5fKdLi7.cjs} +2 -1
- package/dist/HonoEndpointAdaptor-B5fKdLi7.cjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-Cb45sqM9.d.mts → HonoEndpointAdaptor-C2deTEwW.d.mts} +5 -5
- package/dist/{HonoEndpointAdaptor-Cb45sqM9.d.mts.map → HonoEndpointAdaptor-C2deTEwW.d.mts.map} +1 -1
- package/dist/{HonoEndpointAdaptor-VStaYQHr.d.cts → HonoEndpointAdaptor-D3IgM-0B.d.cts} +2 -2
- package/dist/{HonoEndpointAdaptor-VStaYQHr.d.cts.map → HonoEndpointAdaptor-D3IgM-0B.d.cts.map} +1 -1
- package/dist/{HonoEndpointAdaptor-D7N5oiO0.mjs → HonoEndpointAdaptor-DOUODM7n.mjs} +2 -1
- package/dist/HonoEndpointAdaptor-DOUODM7n.mjs.map +1 -0
- package/dist/MswEndpointAdaptor-B41INCc7.mjs +108 -0
- package/dist/MswEndpointAdaptor-B41INCc7.mjs.map +1 -0
- package/dist/MswEndpointAdaptor-CA_fu6Wx.cjs +120 -0
- package/dist/MswEndpointAdaptor-CA_fu6Wx.cjs.map +1 -0
- package/dist/MswEndpointAdaptor-CXgYbOxw.d.mts +101 -0
- package/dist/MswEndpointAdaptor-CXgYbOxw.d.mts.map +1 -0
- package/dist/MswEndpointAdaptor-CsYvrQeB.d.cts +101 -0
- package/dist/MswEndpointAdaptor-CsYvrQeB.d.cts.map +1 -0
- package/dist/{Subscriber-BgB3RRxb.d.mts → Subscriber-9ObcUdcC.d.mts} +2 -2
- package/dist/{Subscriber-BgB3RRxb.d.mts.map → Subscriber-9ObcUdcC.d.mts.map} +1 -1
- package/dist/{Subscriber-BEhOdNQi.mjs → Subscriber-BH76wgkL.mjs} +1 -1
- package/dist/{Subscriber-BEhOdNQi.mjs.map → Subscriber-BH76wgkL.mjs.map} +1 -1
- package/dist/{Subscriber-Scz7hrV6.cjs → Subscriber-BgspJeS4.cjs} +1 -1
- package/dist/{Subscriber-Scz7hrV6.cjs.map → Subscriber-BgspJeS4.cjs.map} +1 -1
- package/dist/{SubscriberBuilder-DlUaG0Ej.mjs → SubscriberBuilder-B4md5wzs.mjs} +2 -2
- package/dist/{SubscriberBuilder-DlUaG0Ej.mjs.map → SubscriberBuilder-B4md5wzs.mjs.map} +1 -1
- package/dist/{SubscriberBuilder-B9uva8fZ.d.cts → SubscriberBuilder-Be7WBbCL.d.cts} +1 -1
- package/dist/{SubscriberBuilder-B9uva8fZ.d.cts.map → SubscriberBuilder-Be7WBbCL.d.cts.map} +1 -1
- package/dist/{SubscriberBuilder-B82h4v-S.cjs → SubscriberBuilder-BtL22ZJ9.cjs} +2 -2
- package/dist/{SubscriberBuilder-B82h4v-S.cjs.map → SubscriberBuilder-BtL22ZJ9.cjs.map} +1 -1
- package/dist/{SubscriberBuilder-DaQkh2Nt.d.mts → SubscriberBuilder-DsfIkgTF.d.mts} +2 -2
- package/dist/{SubscriberBuilder-DaQkh2Nt.d.mts.map → SubscriberBuilder-DsfIkgTF.d.mts.map} +1 -1
- package/dist/{TestEndpointAdaptor-DHVaHmhw.mjs → TestEndpointAdaptor-BFmgf7Fn.mjs} +2 -1
- package/dist/TestEndpointAdaptor-BFmgf7Fn.mjs.map +1 -0
- package/dist/{TestEndpointAdaptor-Bt-uW6SC.d.mts → TestEndpointAdaptor-C79Z-QS4.d.mts} +3 -3
- package/dist/{TestEndpointAdaptor-Bt-uW6SC.d.mts.map → TestEndpointAdaptor-C79Z-QS4.d.mts.map} +1 -1
- package/dist/{TestEndpointAdaptor-BKoJpTGT.cjs → TestEndpointAdaptor-DYLDyAAC.cjs} +2 -1
- package/dist/TestEndpointAdaptor-DYLDyAAC.cjs.map +1 -0
- package/dist/{TestEndpointAdaptor-UKhHj1RR.d.cts → TestEndpointAdaptor-pM8yskbb.d.cts} +2 -2
- package/dist/{TestEndpointAdaptor-UKhHj1RR.d.cts.map → TestEndpointAdaptor-pM8yskbb.d.cts.map} +1 -1
- package/dist/{TestFunctionAdaptor-CH6-gO_B.cjs → TestFunctionAdaptor-B859kIeb.cjs} +1 -1
- package/dist/{TestFunctionAdaptor-CH6-gO_B.cjs.map → TestFunctionAdaptor-B859kIeb.cjs.map} +1 -1
- package/dist/{TestFunctionAdaptor-DzT8GRdR.d.mts → TestFunctionAdaptor-C0A-VqnM.d.mts} +2 -2
- package/dist/{TestFunctionAdaptor-BHk2bDOV.d.cts.map → TestFunctionAdaptor-C0A-VqnM.d.mts.map} +1 -1
- package/dist/{TestFunctionAdaptor-C5CLuR-9.mjs → TestFunctionAdaptor-CqdSlhx1.mjs} +1 -1
- package/dist/{TestFunctionAdaptor-C5CLuR-9.mjs.map → TestFunctionAdaptor-CqdSlhx1.mjs.map} +1 -1
- package/dist/{TestFunctionAdaptor-BHk2bDOV.d.cts → TestFunctionAdaptor-Dbq55dKP.d.cts} +1 -1
- package/dist/{TestFunctionAdaptor-DzT8GRdR.d.mts.map → TestFunctionAdaptor-Dbq55dKP.d.cts.map} +1 -1
- package/dist/{TestSubscriberAdaptor-CPEiqSfE.d.mts → TestSubscriberAdaptor-BEyCFP9G.d.mts} +2 -2
- package/dist/{TestSubscriberAdaptor-CPEiqSfE.d.mts.map → TestSubscriberAdaptor-BEyCFP9G.d.mts.map} +1 -1
- package/dist/{TestSubscriberAdaptor-DQk5xzb0.d.cts → TestSubscriberAdaptor-BknOLRQw.d.cts} +1 -1
- package/dist/{TestSubscriberAdaptor-DQk5xzb0.d.cts.map → TestSubscriberAdaptor-BknOLRQw.d.cts.map} +1 -1
- package/dist/{TestSubscriberAdaptor-CwP3qNJ4.mjs → TestSubscriberAdaptor-CCcviuKa.mjs} +1 -1
- package/dist/{TestSubscriberAdaptor-CwP3qNJ4.mjs.map → TestSubscriberAdaptor-CCcviuKa.mjs.map} +1 -1
- package/dist/{TestSubscriberAdaptor-Dgxr_0vL.cjs → TestSubscriberAdaptor-_69o1d0f.cjs} +1 -1
- package/dist/{TestSubscriberAdaptor-Dgxr_0vL.cjs.map → TestSubscriberAdaptor-_69o1d0f.cjs.map} +1 -1
- package/dist/adaptors/aws.cjs +3 -3
- package/dist/adaptors/aws.d.cts +4 -4
- package/dist/adaptors/aws.d.mts +16 -16
- package/dist/adaptors/aws.mjs +3 -3
- package/dist/adaptors/hono.cjs +1 -1
- package/dist/adaptors/hono.d.cts +2 -2
- package/dist/adaptors/hono.d.mts +9 -9
- package/dist/adaptors/hono.mjs +1 -1
- package/dist/adaptors/testing.cjs +10 -4
- package/dist/adaptors/testing.d.cts +6 -5
- package/dist/adaptors/testing.d.mts +14 -13
- package/dist/adaptors/testing.mjs +8 -4
- package/dist/crons/Cron.cjs +1 -1
- package/dist/crons/Cron.d.cts +1 -1
- package/dist/crons/Cron.d.mts +6 -6
- package/dist/crons/Cron.mjs +1 -1
- package/dist/crons/CronBuilder.cjs +2 -2
- package/dist/crons/CronBuilder.d.cts +2 -2
- package/dist/crons/CronBuilder.d.mts +7 -7
- package/dist/crons/CronBuilder.mjs +2 -2
- package/dist/crons/index.cjs +2 -2
- package/dist/crons/index.d.cts +2 -2
- package/dist/crons/index.d.mts +11 -11
- package/dist/crons/index.mjs +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.cjs +1 -1
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +2 -2
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +10 -10
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.mjs +1 -1
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.cjs +2 -2
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +11 -11
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.mjs +2 -2
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.cjs +2 -2
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +3 -3
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +11 -11
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.mjs +2 -2
- package/dist/endpoints/Authorizer.cjs +1 -1
- package/dist/endpoints/Authorizer.d.mts +1 -1
- package/dist/endpoints/Authorizer.mjs +1 -1
- package/dist/endpoints/Endpoint.d.cts +1 -1
- package/dist/endpoints/Endpoint.d.mts +8 -8
- package/dist/endpoints/EndpointBuilder.cjs +3 -3
- package/dist/endpoints/EndpointBuilder.d.cts +2 -2
- package/dist/endpoints/EndpointBuilder.d.mts +9 -9
- package/dist/endpoints/EndpointBuilder.mjs +3 -3
- package/dist/endpoints/EndpointFactory.cjs +4 -4
- package/dist/endpoints/EndpointFactory.d.cts +3 -3
- package/dist/endpoints/EndpointFactory.d.mts +10 -10
- package/dist/endpoints/EndpointFactory.mjs +4 -4
- package/dist/endpoints/HonoEndpointAdaptor.cjs +1 -1
- package/dist/endpoints/HonoEndpointAdaptor.d.cts +2 -2
- package/dist/endpoints/HonoEndpointAdaptor.d.mts +9 -9
- package/dist/endpoints/HonoEndpointAdaptor.mjs +1 -1
- package/dist/endpoints/MswEndpointAdaptor.cjs +16 -0
- package/dist/endpoints/MswEndpointAdaptor.d.cts +10 -0
- package/dist/endpoints/MswEndpointAdaptor.d.mts +10 -0
- package/dist/endpoints/MswEndpointAdaptor.mjs +15 -0
- package/dist/endpoints/TestEndpointAdaptor.cjs +1 -1
- package/dist/endpoints/TestEndpointAdaptor.d.cts +2 -2
- package/dist/endpoints/TestEndpointAdaptor.d.mts +9 -9
- package/dist/endpoints/TestEndpointAdaptor.mjs +1 -1
- package/dist/endpoints/audit.d.cts +1 -1
- package/dist/endpoints/audit.d.mts +8 -8
- package/dist/endpoints/helpers.d.cts +1 -1
- package/dist/endpoints/helpers.d.mts +8 -8
- package/dist/endpoints/index.cjs +4 -4
- package/dist/endpoints/index.d.cts +7 -7
- package/dist/endpoints/index.d.mts +14 -14
- package/dist/endpoints/index.mjs +4 -4
- package/dist/endpoints/lazyAccessors.d.cts +2 -2
- package/dist/endpoints/lazyAccessors.d.mts +9 -9
- package/dist/endpoints/processAudits.d.cts +1 -1
- package/dist/endpoints/processAudits.d.mts +8 -8
- package/dist/endpoints/rls.cjs +1 -1
- package/dist/endpoints/rls.d.cts +1 -1
- package/dist/endpoints/rls.d.mts +8 -8
- package/dist/endpoints/rls.mjs +1 -1
- package/dist/functions/AWSLambdaFunction.d.mts +4 -4
- package/dist/functions/BaseFunctionBuilder.d.mts +2 -2
- package/dist/functions/Function.d.mts +2 -2
- package/dist/functions/FunctionBuilder.d.mts +4 -4
- package/dist/functions/FunctionExecutionWrapper.d.mts +3 -3
- package/dist/functions/TestFunctionAdaptor.cjs +1 -1
- package/dist/functions/TestFunctionAdaptor.d.cts +1 -1
- package/dist/functions/TestFunctionAdaptor.d.mts +3 -3
- package/dist/functions/TestFunctionAdaptor.mjs +1 -1
- package/dist/functions/index.d.mts +5 -5
- package/dist/index-Cg2UDz1r.d.mts +12 -0
- package/dist/{index-CtMNRkV7.d.mts.map → index-Cg2UDz1r.d.mts.map} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/{lazyAccessors-Ba8HxeIC.d.cts → lazyAccessors-Bxy5DBp4.d.cts} +2 -2
- package/dist/{lazyAccessors-Ba8HxeIC.d.cts.map → lazyAccessors-Bxy5DBp4.d.cts.map} +1 -1
- package/dist/{lazyAccessors-D9tzUZaz.d.mts → lazyAccessors-CWFdtzSR.d.mts} +2 -2
- package/dist/{lazyAccessors-D9tzUZaz.d.mts.map → lazyAccessors-CWFdtzSR.d.mts.map} +1 -1
- package/dist/{publisher-BrzPGnm4.d.cts → publisher-BUDHcaz3.d.cts} +1 -1
- package/dist/{publisher-BrzPGnm4.d.cts.map → publisher-BUDHcaz3.d.cts.map} +1 -1
- package/dist/{publisher-CP4gpv-4.d.mts → publisher-DXglijK_.d.mts} +2 -2
- package/dist/{publisher-CP4gpv-4.d.mts.map → publisher-DXglijK_.d.mts.map} +1 -1
- package/dist/publisher.d.cts +1 -1
- package/dist/publisher.d.mts +2 -2
- package/dist/{rls-7XXX7DvY.mjs → rls-C0r4UKVm.mjs} +1 -1
- package/dist/{rls-7XXX7DvY.mjs.map → rls-C0r4UKVm.mjs.map} +1 -1
- package/dist/{rls-DxFqdIA0.cjs → rls-Cfb6w-tQ.cjs} +1 -1
- package/dist/{rls-DxFqdIA0.cjs.map → rls-Cfb6w-tQ.cjs.map} +1 -1
- package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +3 -3
- package/dist/subscribers/Subscriber.cjs +1 -1
- package/dist/subscribers/Subscriber.d.mts +2 -2
- package/dist/subscribers/Subscriber.mjs +1 -1
- package/dist/subscribers/SubscriberBuilder.cjs +2 -2
- package/dist/subscribers/SubscriberBuilder.d.cts +1 -1
- package/dist/subscribers/SubscriberBuilder.d.mts +3 -3
- package/dist/subscribers/SubscriberBuilder.mjs +2 -2
- package/dist/subscribers/TestSubscriberAdaptor.cjs +1 -1
- package/dist/subscribers/TestSubscriberAdaptor.d.cts +1 -1
- package/dist/subscribers/TestSubscriberAdaptor.d.mts +3 -3
- package/dist/subscribers/TestSubscriberAdaptor.mjs +1 -1
- package/dist/subscribers/index.cjs +2 -2
- package/dist/subscribers/index.d.cts +3 -3
- package/dist/subscribers/index.d.cts.map +1 -1
- package/dist/subscribers/index.d.mts +3 -3
- package/dist/subscribers/index.mjs +2 -2
- package/dist/{telemetry-C-kNOW3C.d.mts → telemetry-BJo1gcV1.d.mts} +1 -1
- package/dist/{telemetry-C-kNOW3C.d.mts.map → telemetry-BJo1gcV1.d.mts.map} +1 -1
- package/dist/telemetry.d.mts +1 -1
- package/dist/{types-aFmq5cKh.d.mts → types-BqPOdHEm.d.mts} +1 -1
- package/dist/{types-aFmq5cKh.d.mts.map → types-BqPOdHEm.d.mts.map} +1 -1
- package/dist/types.d.mts +1 -1
- package/package.json +12 -7
- package/src/adaptors/testing.ts +7 -0
- package/src/endpoints/AmazonApiGatewayEndpointAdaptor.ts +3 -0
- package/src/endpoints/Endpoint.ts +15 -5
- package/src/endpoints/EndpointBuilder.ts +5 -2
- package/src/endpoints/EndpointFactory.ts +18 -4
- package/src/endpoints/HonoEndpointAdaptor.ts +2 -1
- package/src/endpoints/MswEndpointAdaptor.ts +226 -0
- package/src/endpoints/TestEndpointAdaptor.ts +2 -1
- package/src/endpoints/__tests__/MswEndpointAdaptor.spec.ts +219 -0
- package/src/endpoints/__tests__/TestEndpointAdaptor.spec.ts +54 -0
- package/dist/AmazonApiGatewayEndpointAdaptor-Cmm9d_Po.mjs.map +0 -1
- package/dist/AmazonApiGatewayEndpointAdaptor-D7mhDtSL.cjs.map +0 -1
- package/dist/Endpoint-BIvS-rKH.d.mts.map +0 -1
- package/dist/Endpoint-BPh52sXZ.d.cts.map +0 -1
- package/dist/EndpointBuilder-3xH8Gllw.d.mts.map +0 -1
- package/dist/EndpointBuilder-BmVTFp1A.d.cts.map +0 -1
- package/dist/EndpointBuilder-CMzbGG2c.mjs.map +0 -1
- package/dist/EndpointBuilder-QdDf3x87.cjs.map +0 -1
- package/dist/EndpointFactory-AsfUsn-v.cjs.map +0 -1
- package/dist/EndpointFactory-CkPaFZA0.mjs.map +0 -1
- package/dist/EndpointFactory-DKHnUYl8.d.mts.map +0 -1
- package/dist/EndpointFactory-DaDXPRAg.d.cts.map +0 -1
- package/dist/HonoEndpointAdaptor-D7N5oiO0.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-Jbptyuxv.cjs.map +0 -1
- package/dist/TestEndpointAdaptor-BKoJpTGT.cjs.map +0 -1
- package/dist/TestEndpointAdaptor-DHVaHmhw.mjs.map +0 -1
- package/dist/index-CtMNRkV7.d.mts +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../Construct-CX7HyFfT.cjs";
|
|
2
2
|
import "../Subscriber-1rDE7HuM.cjs";
|
|
3
|
-
import { TestSubscriberAdaptor, TestSubscriberRequest } from "../TestSubscriberAdaptor-
|
|
3
|
+
import { TestSubscriberAdaptor, TestSubscriberRequest } from "../TestSubscriberAdaptor-BknOLRQw.cjs";
|
|
4
4
|
export { TestSubscriberAdaptor, TestSubscriberRequest };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "../Construct-
|
|
2
|
-
import "../Subscriber-
|
|
3
|
-
import { TestSubscriberAdaptor, TestSubscriberRequest } from "../TestSubscriberAdaptor-
|
|
1
|
+
import "../Construct-BjpXFNxy.mjs";
|
|
2
|
+
import "../Subscriber-9ObcUdcC.mjs";
|
|
3
|
+
import { TestSubscriberAdaptor, TestSubscriberRequest } from "../TestSubscriberAdaptor-BEyCFP9G.mjs";
|
|
4
4
|
export { TestSubscriberAdaptor, TestSubscriberRequest };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require('../Construct-BXG8cFSm.cjs');
|
|
2
|
-
const require_Subscriber = require('../Subscriber-
|
|
3
|
-
const require_SubscriberBuilder = require('../SubscriberBuilder-
|
|
2
|
+
const require_Subscriber = require('../Subscriber-BgspJeS4.cjs');
|
|
3
|
+
const require_SubscriberBuilder = require('../SubscriberBuilder-BtL22ZJ9.cjs');
|
|
4
4
|
|
|
5
5
|
//#region src/subscribers/index.ts
|
|
6
6
|
const s = new require_SubscriberBuilder.SubscriberBuilder();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import "../Construct-CX7HyFfT.cjs";
|
|
2
2
|
import { Subscriber } from "../Subscriber-1rDE7HuM.cjs";
|
|
3
|
-
import { SubscriberBuilder } from "../SubscriberBuilder-
|
|
4
|
-
import * as
|
|
3
|
+
import { SubscriberBuilder } from "../SubscriberBuilder-Be7WBbCL.cjs";
|
|
4
|
+
import * as _geekmidas_logger10 from "@geekmidas/logger";
|
|
5
5
|
|
|
6
6
|
//#region src/subscribers/index.d.ts
|
|
7
|
-
declare const s: SubscriberBuilder<[],
|
|
7
|
+
declare const s: SubscriberBuilder<[], _geekmidas_logger10.Logger, undefined, undefined, string, []>;
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
|
9
9
|
|
|
10
10
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/subscribers/index.ts"],"sourcesContent":[],"mappings":";;;;;;cAKa,GAAC,sBAA0B,mBAAA,CAA1B,MAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import "../Construct-
|
|
2
|
-
import { Subscriber } from "../Subscriber-
|
|
3
|
-
import { SubscriberBuilder } from "../SubscriberBuilder-
|
|
1
|
+
import "../Construct-BjpXFNxy.mjs";
|
|
2
|
+
import { Subscriber } from "../Subscriber-9ObcUdcC.mjs";
|
|
3
|
+
import { SubscriberBuilder } from "../SubscriberBuilder-DsfIkgTF.mjs";
|
|
4
4
|
import * as _geekmidas_logger10 from "@geekmidas/logger";
|
|
5
5
|
|
|
6
6
|
//#region src/subscribers/index.d.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../Construct-CQ9zV58W.mjs";
|
|
2
|
-
import { Subscriber } from "../Subscriber-
|
|
3
|
-
import { SubscriberBuilder } from "../SubscriberBuilder-
|
|
2
|
+
import { Subscriber } from "../Subscriber-BH76wgkL.mjs";
|
|
3
|
+
import { SubscriberBuilder } from "../SubscriberBuilder-B4md5wzs.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/subscribers/index.ts
|
|
6
6
|
const s = new SubscriberBuilder();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry-
|
|
1
|
+
{"version":3,"file":"telemetry-BJo1gcV1.d.mts","names":[],"sources":["../src/telemetry.ts"],"sourcesContent":[],"mappings":";;;;;;;AA6FmB,UAlFF,gBAAA,CAkFE;EAAgB;;;EAQgB,CAAA,GAAA,EAAA,MAAA,CAAA,EAAA,OAAA;;;;;UAhFlC,gBAAA;;;;;;;;WASP;;;;;UAMO,iBAAA;;;;;;;;;;;;YAcN;;;;;;;;;;;;;;;;;;;;;;;;;;;UA4BM,SAAA;;;;;;;0BAOQ,mBAAmB;;;;;;;oBAQzB,4BAA4B;;;;;;;sBAQ1B,yBAAyB"}
|
package/dist/telemetry.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "./telemetry-
|
|
1
|
+
import { Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse } from "./telemetry-BJo1gcV1.mjs";
|
|
2
2
|
export { Telemetry, TelemetryContext, TelemetryRequest, TelemetryResponse };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-BqPOdHEm.d.mts","names":[],"sources":["../src/types.ts"],"sourcesContent":[],"mappings":";KAAY,6BAAA,MACC,CADD,IACM,CADS,CACP,CADO,CAAA,SAAA,SAAA,GAAA,KAAA,GACwB,CADxB,GAC4B,CAD5B,CAC8B,CAD9B,CAAA,EAAA;AACd,KAGD,UAAA,GAHC,KAAA,GAAA,MAAA,GAAA,KAAA,GAAA,OAAA,GAAA,QAAA,GAAA,SAAA;AAAK,KAWN,eAXM,CAAA,UAWoB,UAXpB,CAAA,GAWkC,SAXlC,CAW4C,CAX5C,CAAA"}
|
package/dist/types.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-
|
|
1
|
+
import { HttpMethod, LowerHttpMethod, RemoveUndefined } from "./types-BqPOdHEm.mjs";
|
|
2
2
|
export { HttpMethod, LowerHttpMethod, RemoveUndefined };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geekmidas/constructs",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -79,14 +79,15 @@
|
|
|
79
79
|
"better-auth": "~1.4.18",
|
|
80
80
|
"kysely": "~0.28.8",
|
|
81
81
|
"pg": "~8.16.3",
|
|
82
|
+
"msw": "~2.10.3",
|
|
82
83
|
"zod": "~4.1.13",
|
|
83
84
|
"@geekmidas/audit": "^2.0.0",
|
|
84
|
-
"@geekmidas/db": "^1.0.1",
|
|
85
85
|
"@geekmidas/cache": "^1.1.0",
|
|
86
|
+
"@geekmidas/db": "^1.0.1",
|
|
86
87
|
"@geekmidas/envkit": "^1.0.4",
|
|
87
88
|
"@geekmidas/errors": "^1.0.0",
|
|
88
|
-
"@geekmidas/logger": "^1.0.0",
|
|
89
89
|
"@geekmidas/events": "^1.1.0",
|
|
90
|
+
"@geekmidas/logger": "^1.0.0",
|
|
90
91
|
"@geekmidas/rate-limit": "^2.0.0",
|
|
91
92
|
"@geekmidas/schema": "^1.0.0",
|
|
92
93
|
"@geekmidas/services": "^1.0.1",
|
|
@@ -96,16 +97,17 @@
|
|
|
96
97
|
"@middy/core": ">=6.3.1",
|
|
97
98
|
"@types/aws-lambda": ">=8.10.92",
|
|
98
99
|
"hono": ">=4.8.2",
|
|
100
|
+
"msw": ">=2.0.0",
|
|
101
|
+
"@geekmidas/db": "^1.0.1",
|
|
99
102
|
"@geekmidas/audit": "^2.0.0",
|
|
100
103
|
"@geekmidas/cache": "^1.1.0",
|
|
101
|
-
"@geekmidas/db": "^1.0.1",
|
|
102
104
|
"@geekmidas/envkit": "^1.0.4",
|
|
103
105
|
"@geekmidas/events": "^1.1.0",
|
|
104
|
-
"@geekmidas/errors": "^1.0.0",
|
|
105
106
|
"@geekmidas/logger": "^1.0.0",
|
|
106
|
-
"@geekmidas/
|
|
107
|
+
"@geekmidas/errors": "^1.0.0",
|
|
107
108
|
"@geekmidas/rate-limit": "^2.0.0",
|
|
108
|
-
"@geekmidas/schema": "^1.0.0"
|
|
109
|
+
"@geekmidas/schema": "^1.0.0",
|
|
110
|
+
"@geekmidas/services": "^1.0.1"
|
|
109
111
|
},
|
|
110
112
|
"peerDependenciesMeta": {
|
|
111
113
|
"@geekmidas/audit": {
|
|
@@ -146,6 +148,9 @@
|
|
|
146
148
|
},
|
|
147
149
|
"hono": {
|
|
148
150
|
"optional": true
|
|
151
|
+
},
|
|
152
|
+
"msw": {
|
|
153
|
+
"optional": true
|
|
149
154
|
}
|
|
150
155
|
},
|
|
151
156
|
"scripts": {
|
package/src/adaptors/testing.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export {
|
|
2
|
+
type CreateMswHandlersOptions,
|
|
3
|
+
type CreateMswHandlersResult,
|
|
4
|
+
createMswHandlers,
|
|
5
|
+
type RegisterContextOptions,
|
|
6
|
+
TEST_CONTEXT_HEADER,
|
|
7
|
+
} from '../endpoints/MswEndpointAdaptor';
|
|
1
8
|
export { TestEndpointAdaptor } from '../endpoints/TestEndpointAdaptor';
|
|
2
9
|
export { TestFunctionAdaptor } from '../functions/TestFunctionAdaptor';
|
|
3
10
|
export { TestSubscriberAdaptor } from '../subscribers/TestSubscriberAdaptor';
|
|
@@ -258,6 +258,9 @@ export abstract class AmazonApiGatewayEndpoint<
|
|
|
258
258
|
services,
|
|
259
259
|
logger,
|
|
260
260
|
session,
|
|
261
|
+
...((req.event as any).db !== undefined && {
|
|
262
|
+
db: (req.event as any).db,
|
|
263
|
+
}),
|
|
261
264
|
body: (req.event as any).body,
|
|
262
265
|
query: (req.event as any).query,
|
|
263
266
|
params: (req.event as any).params,
|
|
@@ -113,8 +113,13 @@ export class Endpoint<
|
|
|
113
113
|
public getSession: SessionFn<TServices, TLogger, TSession, TDatabase> = () =>
|
|
114
114
|
({}) as TSession;
|
|
115
115
|
/** Function to determine if the request is authorized */
|
|
116
|
-
public authorize: AuthorizeFn<
|
|
117
|
-
|
|
116
|
+
public authorize: AuthorizeFn<
|
|
117
|
+
TServices,
|
|
118
|
+
TLogger,
|
|
119
|
+
TSession,
|
|
120
|
+
TInput,
|
|
121
|
+
TDatabase
|
|
122
|
+
> = () => true;
|
|
118
123
|
/** Optional rate limiting configuration */
|
|
119
124
|
public rateLimit?: RateLimitConfig;
|
|
120
125
|
/** Optional authorizer for this endpoint */
|
|
@@ -750,7 +755,9 @@ export interface EndpointOptions<
|
|
|
750
755
|
TAuditAction
|
|
751
756
|
>;
|
|
752
757
|
/** Optional authorization check function */
|
|
753
|
-
authorize:
|
|
758
|
+
authorize:
|
|
759
|
+
| AuthorizeFn<TServices, TLogger, TSession, TInput, TDatabase>
|
|
760
|
+
| undefined;
|
|
754
761
|
/** Optional description for documentation */
|
|
755
762
|
description: string | undefined;
|
|
756
763
|
/** Optional tags for OpenAPI documentation */
|
|
@@ -815,13 +822,15 @@ export type AuthorizeContext<
|
|
|
815
822
|
TLogger extends Logger = Logger,
|
|
816
823
|
TSession = unknown,
|
|
817
824
|
TInput extends EndpointSchemas | undefined = undefined,
|
|
825
|
+
TDatabase = undefined,
|
|
818
826
|
> = {
|
|
819
827
|
services: ServiceRecord<TServices>;
|
|
820
828
|
logger: TLogger;
|
|
821
829
|
header: HeaderFn;
|
|
822
830
|
cookie: CookieFn;
|
|
823
831
|
session: TSession;
|
|
824
|
-
} & InferComposableStandardSchema<TInput
|
|
832
|
+
} & InferComposableStandardSchema<TInput> &
|
|
833
|
+
SessionDatabaseContext<TDatabase>;
|
|
825
834
|
/**
|
|
826
835
|
* Function type for endpoint authorization checks.
|
|
827
836
|
*
|
|
@@ -844,8 +853,9 @@ export type AuthorizeFn<
|
|
|
844
853
|
TLogger extends Logger = Logger,
|
|
845
854
|
TSession = unknown,
|
|
846
855
|
TInput extends EndpointSchemas | undefined = undefined,
|
|
856
|
+
TDatabase = undefined,
|
|
847
857
|
> = (
|
|
848
|
-
ctx: AuthorizeContext<TServices, TLogger, TSession, TInput>,
|
|
858
|
+
ctx: AuthorizeContext<TServices, TLogger, TSession, TInput, TDatabase>,
|
|
849
859
|
) => Promise<boolean> | boolean;
|
|
850
860
|
|
|
851
861
|
/**
|
|
@@ -63,7 +63,8 @@ export class EndpointBuilder<
|
|
|
63
63
|
protected _memorySize?: number;
|
|
64
64
|
_getSession: SessionFn<TServices, TLogger, TSession, TDatabase> = () =>
|
|
65
65
|
({}) as TSession;
|
|
66
|
-
_authorize: AuthorizeFn<TServices, TLogger, TSession, TInput> =
|
|
66
|
+
_authorize: AuthorizeFn<TServices, TLogger, TSession, TInput, TDatabase> =
|
|
67
|
+
() => true;
|
|
67
68
|
_rateLimit?: RateLimitConfig;
|
|
68
69
|
_availableAuthorizers: Authorizer[] = [];
|
|
69
70
|
_authorizerName?: TAuthorizers[number];
|
|
@@ -263,7 +264,9 @@ export class EndpointBuilder<
|
|
|
263
264
|
return this;
|
|
264
265
|
}
|
|
265
266
|
|
|
266
|
-
authorize(
|
|
267
|
+
authorize(
|
|
268
|
+
fn: AuthorizeFn<TServices, TLogger, TSession, TInput, TDatabase>,
|
|
269
|
+
): this {
|
|
267
270
|
this._authorize = fn;
|
|
268
271
|
return this;
|
|
269
272
|
}
|
|
@@ -51,7 +51,13 @@ export class EndpointFactory<
|
|
|
51
51
|
> {
|
|
52
52
|
private defaultServices: TServices = [] as unknown as TServices;
|
|
53
53
|
private basePath: TBasePath = '' as TBasePath;
|
|
54
|
-
private defaultAuthorizeFn?: AuthorizeFn<
|
|
54
|
+
private defaultAuthorizeFn?: AuthorizeFn<
|
|
55
|
+
TServices,
|
|
56
|
+
TLogger,
|
|
57
|
+
TSession,
|
|
58
|
+
undefined,
|
|
59
|
+
TDatabase
|
|
60
|
+
>;
|
|
55
61
|
private defaultEventPublisher:
|
|
56
62
|
| Service<TEventPublisherServiceName, TEventPublisher>
|
|
57
63
|
| undefined;
|
|
@@ -419,7 +425,7 @@ export class EndpointFactory<
|
|
|
419
425
|
|
|
420
426
|
// Create a new factory with authorization
|
|
421
427
|
authorize(
|
|
422
|
-
fn: AuthorizeFn<TServices, TLogger, TSession>,
|
|
428
|
+
fn: AuthorizeFn<TServices, TLogger, TSession, undefined, TDatabase>,
|
|
423
429
|
): EndpointFactory<
|
|
424
430
|
TServices,
|
|
425
431
|
TBasePath,
|
|
@@ -749,7 +755,9 @@ export class EndpointFactory<
|
|
|
749
755
|
>({
|
|
750
756
|
defaultServices: this.defaultServices,
|
|
751
757
|
basePath: this.basePath,
|
|
752
|
-
defaultAuthorizeFn: this.defaultAuthorizeFn
|
|
758
|
+
defaultAuthorizeFn: this.defaultAuthorizeFn as unknown as
|
|
759
|
+
| AuthorizeFn<TServices, TLogger, TSession, undefined, T>
|
|
760
|
+
| undefined,
|
|
753
761
|
defaultLogger: this.defaultLogger,
|
|
754
762
|
// Reset session extractor when database changes - user should call .session() after .database()
|
|
755
763
|
// to get proper type inference for the new database type
|
|
@@ -1117,7 +1125,13 @@ export interface EndpointFactoryOptions<
|
|
|
1117
1125
|
> {
|
|
1118
1126
|
defaultServices?: TServices;
|
|
1119
1127
|
basePath?: TBasePath;
|
|
1120
|
-
defaultAuthorizeFn?: AuthorizeFn<
|
|
1128
|
+
defaultAuthorizeFn?: AuthorizeFn<
|
|
1129
|
+
TServices,
|
|
1130
|
+
TLogger,
|
|
1131
|
+
TSession,
|
|
1132
|
+
undefined,
|
|
1133
|
+
TDatabase
|
|
1134
|
+
>;
|
|
1121
1135
|
defaultLogger?: TLogger;
|
|
1122
1136
|
defaultSessionExtractor?: SessionFn<TServices, TLogger, TSession, TDatabase>;
|
|
1123
1137
|
defaultEventPublisher?: Service<TEventPublisherServiceName, TEventPublisher>;
|
|
@@ -393,6 +393,7 @@ export class HonoEndpoint<
|
|
|
393
393
|
services,
|
|
394
394
|
logger,
|
|
395
395
|
session,
|
|
396
|
+
...(rawDb !== undefined && { db: rawDb }),
|
|
396
397
|
body: features.hasBodyValidation
|
|
397
398
|
? (c.req.valid as any)('json')
|
|
398
399
|
: undefined,
|
|
@@ -402,7 +403,7 @@ export class HonoEndpoint<
|
|
|
402
403
|
params: features.hasParamValidation
|
|
403
404
|
? (c.req.valid as any)('param')
|
|
404
405
|
: undefined,
|
|
405
|
-
});
|
|
406
|
+
} as any);
|
|
406
407
|
|
|
407
408
|
if (!isAuthorized) {
|
|
408
409
|
logger.warn('Unauthorized access attempt');
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
import { EnvironmentParser } from '@geekmidas/envkit';
|
|
2
|
+
import type { Service } from '@geekmidas/services';
|
|
3
|
+
import { ServiceDiscovery } from '@geekmidas/services';
|
|
4
|
+
import { Hono } from 'hono';
|
|
5
|
+
import { type HttpHandler, http } from 'msw';
|
|
6
|
+
import type { Endpoint } from './Endpoint';
|
|
7
|
+
import { HonoEndpoint } from './HonoEndpointAdaptor';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Header used to identify which test context a request belongs to.
|
|
11
|
+
* Each concurrent test registers its own context (services, db transaction, etc.)
|
|
12
|
+
* and the MSW handler looks it up by this header value.
|
|
13
|
+
*/
|
|
14
|
+
export const TEST_CONTEXT_HEADER = 'x-test-context-id';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Per-test context containing an isolated ServiceDiscovery instance.
|
|
18
|
+
* Registered in the context map and looked up per-request via the context ID header.
|
|
19
|
+
*/
|
|
20
|
+
export interface MswTestContext {
|
|
21
|
+
serviceDiscovery: ServiceDiscovery<any>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Options for creating MSW handlers from endpoint constructs.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```typescript
|
|
29
|
+
* import { createMswHandlers, registerTestContext } from '@geekmidas/constructs/testing';
|
|
30
|
+
* import { setupServer } from 'msw/node';
|
|
31
|
+
*
|
|
32
|
+
* // Create handlers once (global)
|
|
33
|
+
* const { handlers, registerContext, removeContext } = createMswHandlers(
|
|
34
|
+
* [getUsers, createUser],
|
|
35
|
+
* { baseURL: 'http://localhost:3000' },
|
|
36
|
+
* );
|
|
37
|
+
* const server = setupServer(...handlers);
|
|
38
|
+
*
|
|
39
|
+
* // Per test: register an isolated context with its own services/transaction
|
|
40
|
+
* it('should list users', async ({ db }) => {
|
|
41
|
+
* const contextId = crypto.randomUUID();
|
|
42
|
+
* registerContext(contextId, {
|
|
43
|
+
* services: { database: db, auth: mockAuth },
|
|
44
|
+
* });
|
|
45
|
+
*
|
|
46
|
+
* const api = createApi({
|
|
47
|
+
* baseURL: 'http://localhost:3000',
|
|
48
|
+
* headers: { [TEST_CONTEXT_HEADER]: contextId },
|
|
49
|
+
* });
|
|
50
|
+
*
|
|
51
|
+
* const result = await api('GET /users');
|
|
52
|
+
* expect(result).toBeDefined();
|
|
53
|
+
*
|
|
54
|
+
* removeContext(contextId);
|
|
55
|
+
* });
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export interface CreateMswHandlersOptions {
|
|
59
|
+
/** Base URL the client fetches from (e.g., 'http://localhost:3000') */
|
|
60
|
+
baseURL: string;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Options for registering a per-test context.
|
|
65
|
+
* Follows the same pattern as TestRequestAdaptor — services, database,
|
|
66
|
+
* publisher, and auditorStorage are provided explicitly.
|
|
67
|
+
*/
|
|
68
|
+
export interface RegisterContextOptions {
|
|
69
|
+
/** Service instances keyed by serviceName */
|
|
70
|
+
services?: Record<string, unknown>;
|
|
71
|
+
/** Database instance — required when endpoints use .database() */
|
|
72
|
+
database?: unknown;
|
|
73
|
+
/** Event publisher service definition */
|
|
74
|
+
publisher?: Service;
|
|
75
|
+
/** Audit storage instance — required when endpoints use .auditor() */
|
|
76
|
+
auditorStorage?: unknown;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const MSW_HTTP_METHODS = [
|
|
80
|
+
'get',
|
|
81
|
+
'post',
|
|
82
|
+
'put',
|
|
83
|
+
'patch',
|
|
84
|
+
'delete',
|
|
85
|
+
'options',
|
|
86
|
+
] as const;
|
|
87
|
+
|
|
88
|
+
type MswHttpMethod = (typeof MSW_HTTP_METHODS)[number];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Result of creating MSW handlers from endpoint constructs.
|
|
92
|
+
*/
|
|
93
|
+
export interface CreateMswHandlersResult {
|
|
94
|
+
/** MSW handlers to pass to setupServer() */
|
|
95
|
+
handlers: HttpHandler[];
|
|
96
|
+
/** Register an isolated context for a test */
|
|
97
|
+
registerContext: (id: string, options: RegisterContextOptions) => void;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Creates MSW HTTP handlers from endpoint constructs.
|
|
102
|
+
*
|
|
103
|
+
* Mounts endpoints on a Hono app and creates MSW handlers that intercept
|
|
104
|
+
* fetch requests and route them through `app.request()` — giving frontend
|
|
105
|
+
* tests full endpoint behavior (validation, auth, sessions) without HTTP.
|
|
106
|
+
*
|
|
107
|
+
* Each test registers its own isolated context via `registerContext()`,
|
|
108
|
+
* which is resolved per-request using the `x-test-context-id` header.
|
|
109
|
+
* This allows concurrent tests with their own transactions and services.
|
|
110
|
+
*
|
|
111
|
+
* @param endpoints - Array of endpoint constructs to create handlers for
|
|
112
|
+
* @param options - Configuration including baseURL
|
|
113
|
+
* @returns MSW handlers, the Hono app, and context management functions
|
|
114
|
+
*/
|
|
115
|
+
export function createMswHandlers(
|
|
116
|
+
endpoints: Endpoint<any, any, any, any, any, any>[],
|
|
117
|
+
options: CreateMswHandlersOptions,
|
|
118
|
+
): CreateMswHandlersResult {
|
|
119
|
+
const { baseURL } = options;
|
|
120
|
+
const contexts = new Map<string, MswTestContext>();
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* Register an isolated context for a test.
|
|
124
|
+
* Creates a fresh ServiceDiscovery and pre-registers all provided services.
|
|
125
|
+
*/
|
|
126
|
+
function registerContext(id: string, ctxOptions: RegisterContextOptions) {
|
|
127
|
+
const envParser = new EnvironmentParser({});
|
|
128
|
+
const serviceDiscovery = new ServiceDiscovery(envParser);
|
|
129
|
+
|
|
130
|
+
const serviceDefs: Service[] = [];
|
|
131
|
+
|
|
132
|
+
// Register explicit services
|
|
133
|
+
if (ctxOptions.services) {
|
|
134
|
+
for (const [name, instance] of Object.entries(ctxOptions.services)) {
|
|
135
|
+
serviceDefs.push({
|
|
136
|
+
serviceName: name,
|
|
137
|
+
register: () => instance,
|
|
138
|
+
} as Service);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
// Register database service from endpoint metadata
|
|
143
|
+
if (ctxOptions.database !== undefined) {
|
|
144
|
+
for (const endpoint of endpoints) {
|
|
145
|
+
if (endpoint.databaseService) {
|
|
146
|
+
serviceDefs.push({
|
|
147
|
+
serviceName: endpoint.databaseService.serviceName,
|
|
148
|
+
register: () => ctxOptions.database,
|
|
149
|
+
} as Service);
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Register publisher service
|
|
156
|
+
if (ctxOptions.publisher) {
|
|
157
|
+
serviceDefs.push(ctxOptions.publisher);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Register auditor storage service from endpoint metadata
|
|
161
|
+
if (ctxOptions.auditorStorage !== undefined) {
|
|
162
|
+
for (const endpoint of endpoints) {
|
|
163
|
+
if (endpoint.auditorStorageService) {
|
|
164
|
+
serviceDefs.push({
|
|
165
|
+
serviceName: endpoint.auditorStorageService.serviceName,
|
|
166
|
+
register: () => ctxOptions.auditorStorage,
|
|
167
|
+
} as Service);
|
|
168
|
+
break;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
if (serviceDefs.length > 0) {
|
|
174
|
+
serviceDiscovery.register(serviceDefs);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
contexts.set(id, { serviceDiscovery });
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
// Create a Hono app per-request that uses the correct ServiceDiscovery.
|
|
181
|
+
// We use a wrapper app that resolves the context from the header,
|
|
182
|
+
// then delegates to a context-specific Hono app.
|
|
183
|
+
const handlers: HttpHandler[] = [];
|
|
184
|
+
|
|
185
|
+
for (const endpoint of endpoints) {
|
|
186
|
+
const method = endpoint.method.toLowerCase() as MswHttpMethod;
|
|
187
|
+
if (!MSW_HTTP_METHODS.includes(method)) continue;
|
|
188
|
+
|
|
189
|
+
const mswUrl = `${baseURL}${endpoint.route}`;
|
|
190
|
+
const mswMethod = http[method];
|
|
191
|
+
|
|
192
|
+
handlers.push(
|
|
193
|
+
mswMethod(mswUrl, async ({ request }) => {
|
|
194
|
+
const contextId = request.headers.get(TEST_CONTEXT_HEADER);
|
|
195
|
+
const ctx = contextId ? contexts.get(contextId) : undefined;
|
|
196
|
+
|
|
197
|
+
if (!ctx) {
|
|
198
|
+
return new Response(
|
|
199
|
+
JSON.stringify({
|
|
200
|
+
error: 'Missing or unknown test context ID',
|
|
201
|
+
hint: `Set the '${TEST_CONTEXT_HEADER}' header to a registered context ID`,
|
|
202
|
+
}),
|
|
203
|
+
{ status: 500, headers: { 'content-type': 'application/json' } },
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Build a fresh Hono app with this context's ServiceDiscovery
|
|
208
|
+
const app = new Hono();
|
|
209
|
+
HonoEndpoint.addRoute(endpoint, ctx.serviceDiscovery as any, app);
|
|
210
|
+
|
|
211
|
+
const response = await app.request(request);
|
|
212
|
+
|
|
213
|
+
return new Response(response.body, {
|
|
214
|
+
status: response.status,
|
|
215
|
+
statusText: response.statusText,
|
|
216
|
+
headers: response.headers,
|
|
217
|
+
});
|
|
218
|
+
}),
|
|
219
|
+
);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
return {
|
|
223
|
+
handlers,
|
|
224
|
+
registerContext,
|
|
225
|
+
};
|
|
226
|
+
}
|
|
@@ -216,10 +216,11 @@ export class TestEndpointAdaptor<
|
|
|
216
216
|
services: ctx.services,
|
|
217
217
|
logger,
|
|
218
218
|
session,
|
|
219
|
+
...(rawDb !== undefined && { db: rawDb }),
|
|
219
220
|
body,
|
|
220
221
|
query,
|
|
221
222
|
params,
|
|
222
|
-
});
|
|
223
|
+
} as any);
|
|
223
224
|
|
|
224
225
|
if (!isAuthorized) {
|
|
225
226
|
logger.warn('Unauthorized access attempt');
|