@geekmidas/constructs 0.0.6 → 0.0.9
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/{AWSLambdaFunction-qA5LqPsv.cjs → AWSLambdaFunction-CMLZ3GaC.cjs} +3 -3
- package/dist/{AWSLambdaFunction-qA5LqPsv.cjs.map → AWSLambdaFunction-CMLZ3GaC.cjs.map} +1 -1
- package/dist/{AWSLambdaFunction-CANc3Qo2.d.mts → AWSLambdaFunction-D5V3YVqv.d.cts} +5 -5
- package/dist/{AWSLambdaFunction-CwagvPG3.d.cts → AWSLambdaFunction-_J0MjixY.d.mts} +5 -5
- package/dist/{AWSLambdaFunction-DWIZYsCy.mjs → AWSLambdaFunction-egVcP17n.mjs} +3 -3
- package/dist/{AWSLambdaFunction-DWIZYsCy.mjs.map → AWSLambdaFunction-egVcP17n.mjs.map} +1 -1
- package/dist/{AWSLambdaSubscriberAdaptor-QKVxR6qh.d.cts → AWSLambdaSubscriberAdaptor-DjG1ME3P.d.mts} +4 -4
- package/dist/{AWSLambdaSubscriberAdaptor-C6JYIZxn.d.mts → AWSLambdaSubscriberAdaptor-J_pSz6pu.d.cts} +4 -4
- package/dist/{AmazonApiGatewayEndpointAdaptor-BFhJ2Rpz.d.cts → AmazonApiGatewayEndpointAdaptor-BnNd8tCz.d.cts} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-BrB3RfbI.d.mts → AmazonApiGatewayEndpointAdaptor-C-17dUai.d.mts} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-Bmz6Cy1e.mjs → AmazonApiGatewayEndpointAdaptor-CQLjGSJe.mjs} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-Bmz6Cy1e.mjs.map → AmazonApiGatewayEndpointAdaptor-CQLjGSJe.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayEndpointAdaptor-B8mozTcG.cjs → AmazonApiGatewayEndpointAdaptor-DPaV_5wG.cjs} +2 -2
- package/dist/{AmazonApiGatewayEndpointAdaptor-B8mozTcG.cjs.map → AmazonApiGatewayEndpointAdaptor-DPaV_5wG.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-Bd-o8ese.d.cts → AmazonApiGatewayV1EndpointAdaptor-BC-a2tt3.d.cts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-BtNXt0-4.d.mts → AmazonApiGatewayV1EndpointAdaptor-Cjud-a6p.d.mts} +3 -3
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-24g3dLn5.mjs → AmazonApiGatewayV1EndpointAdaptor-DEBcyZe0.mjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-24g3dLn5.mjs.map → AmazonApiGatewayV1EndpointAdaptor-DEBcyZe0.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-D4eZ-fx5.cjs → AmazonApiGatewayV1EndpointAdaptor-DkFcSRwT.cjs} +2 -2
- package/dist/{AmazonApiGatewayV1EndpointAdaptor-D4eZ-fx5.cjs.map → AmazonApiGatewayV1EndpointAdaptor-DkFcSRwT.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-Cc40RThv.mjs → AmazonApiGatewayV2EndpointAdaptor-BB7t7LE2.mjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-Cc40RThv.mjs.map → AmazonApiGatewayV2EndpointAdaptor-BB7t7LE2.mjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-J6tACl-N.cjs → AmazonApiGatewayV2EndpointAdaptor-BQ21ry6s.cjs} +2 -2
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-J6tACl-N.cjs.map → AmazonApiGatewayV2EndpointAdaptor-BQ21ry6s.cjs.map} +1 -1
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-DAJdtgek.d.mts → AmazonApiGatewayV2EndpointAdaptor-C31Xcwmc.d.mts} +3 -3
- package/dist/{AmazonApiGatewayV2EndpointAdaptor-DX-Uci5w.d.cts → AmazonApiGatewayV2EndpointAdaptor-zNFUPxSY.d.cts} +3 -3
- package/dist/Authorizer-Bbk9ziuG.d.mts +29 -0
- package/dist/Authorizer-iXsSB600.d.cts +29 -0
- package/dist/{BaseFunctionBuilder-DtO4Nwxm.cjs → BaseFunctionBuilder-B-kdtkzI.cjs} +2 -2
- package/dist/{BaseFunctionBuilder-DtO4Nwxm.cjs.map → BaseFunctionBuilder-B-kdtkzI.cjs.map} +1 -1
- package/dist/{BaseFunctionBuilder-5QCHkchp.d.cts → BaseFunctionBuilder-C4ZJPkIZ.d.cts} +2 -2
- package/dist/{BaseFunctionBuilder-Dda7AiID.d.mts → BaseFunctionBuilder-CxBX0arJ.d.mts} +2 -2
- package/dist/{BaseFunctionBuilder-BPE9JBbT.mjs → BaseFunctionBuilder-DOhEn5Ce.mjs} +2 -2
- package/dist/{BaseFunctionBuilder-BPE9JBbT.mjs.map → BaseFunctionBuilder-DOhEn5Ce.mjs.map} +1 -1
- package/dist/{Construct-BbKCIPQm.mjs → Construct-B-O9OBS1.mjs} +4 -2
- package/dist/Construct-B-O9OBS1.mjs.map +1 -0
- package/dist/{Construct-BSEs6uwW.cjs → Construct-BtfN2fcm.cjs} +4 -2
- package/dist/Construct-BtfN2fcm.cjs.map +1 -0
- package/dist/{Construct-Bm-PSO2V.d.cts → Construct-ci5u8Xnu.d.cts} +4 -2
- package/dist/{Construct-DdyYENBD.d.mts → Construct-zhmcmIdY.d.mts} +4 -2
- package/dist/Construct.cjs +1 -1
- package/dist/Construct.d.cts +1 -1
- package/dist/Construct.d.mts +1 -1
- package/dist/Construct.mjs +1 -1
- package/dist/{Cron-BxMXmn4t.d.cts → Cron-ByNYsQDH.d.mts} +4 -4
- package/dist/{Cron-z0RiwSnT.mjs → Cron-D8DPUXBd.mjs} +5 -5
- package/dist/Cron-D8DPUXBd.mjs.map +1 -0
- package/dist/{Cron-NDBlJhb3.d.mts → Cron-DkPL-Fms.d.cts} +4 -4
- package/dist/{Cron-D6MyCqby.cjs → Cron-sOrsPuQj.cjs} +5 -5
- package/dist/Cron-sOrsPuQj.cjs.map +1 -0
- package/dist/{CronBuilder-C6K5AbIO.d.cts → CronBuilder-BknVTWLE.d.mts} +6 -5
- package/dist/{CronBuilder-s5x8V8hH.d.mts → CronBuilder-BqTTozUi.d.cts} +6 -5
- package/dist/{CronBuilder-BLTgwOWp.mjs → CronBuilder-ChyrDobL.mjs} +10 -5
- package/dist/CronBuilder-ChyrDobL.mjs.map +1 -0
- package/dist/{CronBuilder-BOsYnZIm.cjs → CronBuilder-Kvz1GiUp.cjs} +10 -5
- package/dist/CronBuilder-Kvz1GiUp.cjs.map +1 -0
- package/dist/{Endpoint-COGAflGh.cjs → Endpoint-Bghj0fiL.cjs} +21 -12
- package/dist/Endpoint-Bghj0fiL.cjs.map +1 -0
- package/dist/{Endpoint-C7jPJzAH.d.mts → Endpoint-C16whGI-.d.mts} +45 -13
- package/dist/{Endpoint-DLLZvqoh.mjs → Endpoint-DCJz2VQ_.mjs} +21 -12
- package/dist/Endpoint-DCJz2VQ_.mjs.map +1 -0
- package/dist/{Endpoint-XUMNAXYy.d.cts → Endpoint-zHPjZ35J.d.cts} +45 -13
- package/dist/{EndpointBuilder-t6fVEKBH.d.cts → EndpointBuilder-B5l7zQU1.d.cts} +18 -12
- package/dist/{EndpointBuilder-DpmUw--c.mjs → EndpointBuilder-B6xIAruu.mjs} +28 -5
- package/dist/EndpointBuilder-B6xIAruu.mjs.map +1 -0
- package/dist/{EndpointBuilder-CFtWQhcv.d.mts → EndpointBuilder-BzqR0xvt.d.mts} +18 -12
- package/dist/{EndpointBuilder-DUE8ETVR.cjs → EndpointBuilder-i7-4ieP_.cjs} +28 -5
- package/dist/EndpointBuilder-i7-4ieP_.cjs.map +1 -0
- package/dist/{EndpointFactory-YAR24M2i.cjs → EndpointFactory-CYTBPu_G.cjs} +41 -10
- package/dist/EndpointFactory-CYTBPu_G.cjs.map +1 -0
- package/dist/{EndpointFactory-CuJUCyvZ.mjs → EndpointFactory-CYuT-nt-.mjs} +41 -10
- package/dist/EndpointFactory-CYuT-nt-.mjs.map +1 -0
- package/dist/{EndpointFactory-DInjHvFR.d.cts → EndpointFactory-KkyIOE62.d.cts} +28 -20
- package/dist/{EndpointFactory-DBRGrXAy.d.mts → EndpointFactory-VnSAdwdv.d.mts} +28 -20
- package/dist/{Function-CbO2NZx-.cjs → Function-BCEAZFyL.cjs} +4 -5
- package/dist/Function-BCEAZFyL.cjs.map +1 -0
- package/dist/{Function-BP58p9Mp.d.cts → Function-BbLYIKLL.d.cts} +3 -4
- package/dist/{Function-C5mW-38v.mjs → Function-CmfMIDoS.mjs} +4 -5
- package/dist/Function-CmfMIDoS.mjs.map +1 -0
- package/dist/{Function-C98H68DW.d.mts → Function-DFRZZCC-.d.mts} +3 -4
- package/dist/{FunctionBuilder-DuOeWCAl.cjs → FunctionBuilder-BqivB_cc.cjs} +11 -5
- package/dist/FunctionBuilder-BqivB_cc.cjs.map +1 -0
- package/dist/{FunctionBuilder-BS1KgxA_.d.cts → FunctionBuilder-DdGjpiFT.d.cts} +6 -4
- package/dist/{FunctionBuilder-DBwR7jg7.d.mts → FunctionBuilder-DuktGyZc.d.mts} +6 -4
- package/dist/{FunctionBuilder-CosgPmMl.mjs → FunctionBuilder-QvqvEyFa.mjs} +11 -5
- package/dist/FunctionBuilder-QvqvEyFa.mjs.map +1 -0
- package/dist/{FunctionExecutionWrapper-B0V7V8YS.d.mts → FunctionExecutionWrapper-CAHR74yI.d.mts} +2 -2
- package/dist/{FunctionExecutionWrapper-Bx-Dl-2a.d.cts → FunctionExecutionWrapper-CRYi047B.d.cts} +2 -2
- package/dist/{FunctionExecutionWrapper-XGrSAAPD.mjs → FunctionExecutionWrapper-JsZIHhcl.mjs} +2 -2
- package/dist/{FunctionExecutionWrapper-XGrSAAPD.mjs.map → FunctionExecutionWrapper-JsZIHhcl.mjs.map} +1 -1
- package/dist/{FunctionExecutionWrapper-CElXEjPe.cjs → FunctionExecutionWrapper-TJxf9p4v.cjs} +2 -2
- package/dist/{FunctionExecutionWrapper-CElXEjPe.cjs.map → FunctionExecutionWrapper-TJxf9p4v.cjs.map} +1 -1
- package/dist/{HonoEndpointAdaptor-BlT1rWHV.mjs → HonoEndpointAdaptor-8eYrSFRn.mjs} +33 -16
- package/dist/HonoEndpointAdaptor-8eYrSFRn.mjs.map +1 -0
- package/dist/{HonoEndpointAdaptor-C9Xe2pRp.d.mts → HonoEndpointAdaptor-DAsZoX2a.d.mts} +5 -4
- package/dist/{HonoEndpointAdaptor-CGSqpnCD.d.cts → HonoEndpointAdaptor-lYw6EN1Q.d.cts} +5 -4
- package/dist/{HonoEndpointAdaptor-Ds433Q8w.cjs → HonoEndpointAdaptor-vWSpXdNp.cjs} +20 -3
- package/dist/HonoEndpointAdaptor-vWSpXdNp.cjs.map +1 -0
- package/dist/{Subscriber-G7EUI3yc.cjs → Subscriber-BdiqU7da.cjs} +2 -2
- package/dist/{Subscriber-G7EUI3yc.cjs.map → Subscriber-BdiqU7da.cjs.map} +1 -1
- package/dist/{Subscriber-BoFm12i_.d.cts → Subscriber-Cy28j8MS.d.cts} +2 -2
- package/dist/{Subscriber-BTwKnz3c.mjs → Subscriber-bJSqvjdK.mjs} +2 -2
- package/dist/{Subscriber-BTwKnz3c.mjs.map → Subscriber-bJSqvjdK.mjs.map} +1 -1
- package/dist/{Subscriber-BxH6n8zQ.d.mts → Subscriber-g3IWM1_d.d.mts} +2 -2
- package/dist/{SubscriberBuilder-BpSDPzBz.d.mts → SubscriberBuilder-BzK8kc2a.d.cts} +3 -3
- package/dist/{SubscriberBuilder-C1me_972.mjs → SubscriberBuilder-CyCyjT6L.mjs} +2 -2
- package/dist/{SubscriberBuilder-C1me_972.mjs.map → SubscriberBuilder-CyCyjT6L.mjs.map} +1 -1
- package/dist/{SubscriberBuilder-C6iZvuDe.cjs → SubscriberBuilder-JTJcIZYy.cjs} +2 -2
- package/dist/{SubscriberBuilder-C6iZvuDe.cjs.map → SubscriberBuilder-JTJcIZYy.cjs.map} +1 -1
- package/dist/{SubscriberBuilder-DgljKtYu.d.cts → SubscriberBuilder-YjQ7qIpQ.d.mts} +3 -3
- package/dist/{TestEndpointAdaptor-BG6fzAOx.mjs → TestEndpointAdaptor-BevV2LLd.mjs} +33 -7
- package/dist/TestEndpointAdaptor-BevV2LLd.mjs.map +1 -0
- package/dist/{TestEndpointAdaptor-Db0cm1fb.d.mts → TestEndpointAdaptor-DGWuai69.d.mts} +10 -4
- package/dist/{TestEndpointAdaptor-BaQaTy_1.cjs → TestEndpointAdaptor-DupnzEnS.cjs} +33 -7
- package/dist/TestEndpointAdaptor-DupnzEnS.cjs.map +1 -0
- package/dist/{TestEndpointAdaptor-v7A-7hTs.d.cts → TestEndpointAdaptor-uXliWYjS.d.cts} +10 -4
- package/dist/adaptors/aws.cjs +11 -11
- package/dist/adaptors/aws.d.cts +14 -13
- package/dist/adaptors/aws.d.mts +14 -13
- package/dist/adaptors/aws.mjs +11 -11
- package/dist/adaptors/hono.cjs +8 -8
- package/dist/adaptors/hono.d.cts +8 -7
- package/dist/adaptors/hono.d.mts +8 -7
- package/dist/adaptors/hono.mjs +8 -8
- package/dist/adaptors/testing.cjs +7 -7
- package/dist/adaptors/testing.d.cts +8 -7
- package/dist/adaptors/testing.d.mts +8 -7
- package/dist/adaptors/testing.mjs +7 -7
- package/dist/crons/Cron.cjs +6 -6
- package/dist/crons/Cron.d.cts +6 -6
- package/dist/crons/Cron.d.mts +6 -6
- package/dist/crons/Cron.mjs +6 -6
- package/dist/crons/CronBuilder.cjs +7 -7
- package/dist/crons/CronBuilder.d.cts +7 -7
- package/dist/crons/CronBuilder.d.mts +7 -7
- package/dist/crons/CronBuilder.mjs +7 -7
- package/dist/crons/index.cjs +7 -7
- package/dist/crons/index.d.cts +11 -11
- package/dist/crons/index.d.mts +7 -7
- package/dist/crons/index.mjs +7 -7
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.cjs +7 -7
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.cts +8 -7
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.d.mts +8 -7
- package/dist/endpoints/AmazonApiGatewayEndpointAdaptor.mjs +7 -7
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.cjs +8 -8
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.cts +9 -8
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.d.mts +9 -8
- package/dist/endpoints/AmazonApiGatewayV1EndpointAdaptor.mjs +8 -8
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.cjs +8 -8
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.cts +9 -8
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.d.mts +9 -8
- package/dist/endpoints/AmazonApiGatewayV2EndpointAdaptor.mjs +8 -8
- package/dist/endpoints/Authorizer.cjs +15 -0
- package/dist/endpoints/Authorizer.cjs.map +1 -0
- package/dist/endpoints/Authorizer.d.cts +2 -0
- package/dist/endpoints/Authorizer.d.mts +2 -0
- package/dist/endpoints/Authorizer.mjs +14 -0
- package/dist/endpoints/Authorizer.mjs.map +1 -0
- package/dist/endpoints/Endpoint.cjs +6 -6
- package/dist/endpoints/Endpoint.d.cts +7 -6
- package/dist/endpoints/Endpoint.d.mts +7 -6
- package/dist/endpoints/Endpoint.mjs +6 -6
- package/dist/endpoints/EndpointBuilder.cjs +7 -7
- package/dist/endpoints/EndpointBuilder.d.cts +8 -7
- package/dist/endpoints/EndpointBuilder.d.mts +8 -7
- package/dist/endpoints/EndpointBuilder.mjs +7 -7
- package/dist/endpoints/EndpointFactory.cjs +8 -8
- package/dist/endpoints/EndpointFactory.d.cts +9 -8
- package/dist/endpoints/EndpointFactory.d.mts +9 -8
- package/dist/endpoints/EndpointFactory.mjs +8 -8
- package/dist/endpoints/HonoEndpointAdaptor.cjs +8 -8
- package/dist/endpoints/HonoEndpointAdaptor.d.cts +8 -7
- package/dist/endpoints/HonoEndpointAdaptor.d.mts +8 -7
- package/dist/endpoints/HonoEndpointAdaptor.mjs +8 -8
- package/dist/endpoints/TestEndpointAdaptor.cjs +7 -7
- package/dist/endpoints/TestEndpointAdaptor.d.cts +9 -8
- package/dist/endpoints/TestEndpointAdaptor.d.mts +9 -8
- package/dist/endpoints/TestEndpointAdaptor.mjs +7 -7
- package/dist/endpoints/helpers.cjs +7 -7
- package/dist/endpoints/helpers.d.cts +7 -6
- package/dist/endpoints/helpers.d.mts +7 -6
- package/dist/endpoints/helpers.mjs +7 -7
- package/dist/endpoints/index.cjs +8 -8
- package/dist/endpoints/index.d.cts +11 -10
- package/dist/endpoints/index.d.mts +11 -10
- package/dist/endpoints/index.mjs +8 -8
- package/dist/functions/AWSLambdaFunction.cjs +6 -6
- package/dist/functions/AWSLambdaFunction.d.cts +4 -4
- package/dist/functions/AWSLambdaFunction.d.mts +4 -4
- package/dist/functions/AWSLambdaFunction.mjs +6 -6
- package/dist/functions/BaseFunctionBuilder.cjs +2 -2
- package/dist/functions/BaseFunctionBuilder.d.cts +2 -2
- package/dist/functions/BaseFunctionBuilder.d.mts +2 -2
- package/dist/functions/BaseFunctionBuilder.mjs +2 -2
- package/dist/functions/Function.cjs +2 -2
- package/dist/functions/Function.d.cts +2 -2
- package/dist/functions/Function.d.mts +2 -2
- package/dist/functions/Function.mjs +2 -2
- package/dist/functions/FunctionBuilder.cjs +4 -4
- package/dist/functions/FunctionBuilder.d.cts +4 -4
- package/dist/functions/FunctionBuilder.d.mts +4 -4
- package/dist/functions/FunctionBuilder.mjs +4 -4
- package/dist/functions/FunctionExecutionWrapper.cjs +5 -5
- package/dist/functions/FunctionExecutionWrapper.d.cts +3 -3
- package/dist/functions/FunctionExecutionWrapper.d.mts +3 -3
- package/dist/functions/FunctionExecutionWrapper.mjs +5 -5
- package/dist/functions/TestFunctionAdaptor.cjs +4 -4
- package/dist/functions/TestFunctionAdaptor.d.cts +2 -2
- package/dist/functions/TestFunctionAdaptor.d.mts +2 -2
- package/dist/functions/TestFunctionAdaptor.mjs +4 -4
- package/dist/functions/index.cjs +5 -5
- package/dist/functions/index.d.cts +5 -5
- package/dist/functions/index.d.mts +5 -5
- package/dist/functions/index.mjs +5 -5
- package/dist/{functions-DVDb5wEA.cjs → functions-B9mEg9D9.cjs} +2 -2
- package/dist/{functions-DVDb5wEA.cjs.map → functions-B9mEg9D9.cjs.map} +1 -1
- package/dist/functions-DcQZSOHg.mjs +8 -0
- package/dist/{functions-mM-jcphA.mjs.map → functions-DcQZSOHg.mjs.map} +1 -1
- package/dist/{helpers-go4jiRvV.cjs → helpers-BJrzAmhb.cjs} +2 -2
- package/dist/{helpers-go4jiRvV.cjs.map → helpers-BJrzAmhb.cjs.map} +1 -1
- package/dist/{helpers-CM0U-4Vk.mjs → helpers-D_UKinz8.mjs} +2 -2
- package/dist/{helpers-CM0U-4Vk.mjs.map → helpers-D_UKinz8.mjs.map} +1 -1
- package/dist/index-DQt3pQtF.d.mts +9 -0
- package/dist/index-Dq-LQIwK.d.cts +9 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/publisher.d.cts +1 -1
- package/dist/publisher.d.mts +1 -1
- package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.cts +3 -3
- package/dist/subscribers/AWSLambdaSubscriberAdaptor.d.mts +3 -3
- package/dist/subscribers/Subscriber.cjs +2 -2
- package/dist/subscribers/Subscriber.d.cts +2 -2
- package/dist/subscribers/Subscriber.d.mts +2 -2
- package/dist/subscribers/Subscriber.mjs +2 -2
- package/dist/subscribers/SubscriberBuilder.cjs +3 -3
- package/dist/subscribers/SubscriberBuilder.d.cts +3 -3
- package/dist/subscribers/SubscriberBuilder.d.mts +3 -3
- package/dist/subscribers/SubscriberBuilder.mjs +3 -3
- package/dist/subscribers/index.cjs +3 -3
- package/dist/subscribers/index.d.cts +5 -5
- package/dist/subscribers/index.d.mts +5 -5
- package/dist/subscribers/index.mjs +3 -3
- package/package.json +5 -5
- package/src/Construct.ts +2 -0
- package/src/crons/Cron.ts +2 -0
- package/src/crons/CronBuilder.ts +8 -0
- package/src/crons/__tests__/CronBuilder.state-isolation.spec.ts +227 -0
- package/src/endpoints/Authorizer.ts +34 -0
- package/src/endpoints/Endpoint.ts +67 -14
- package/src/endpoints/EndpointBuilder.ts +79 -12
- package/src/endpoints/EndpointFactory.ts +106 -27
- package/src/endpoints/HonoEndpointAdaptor.ts +29 -0
- package/src/endpoints/TestEndpointAdaptor.ts +75 -14
- package/src/endpoints/__tests__/Endpoint.cookies.spec.ts +85 -0
- package/src/endpoints/__tests__/Endpoint.headers.spec.ts +187 -0
- package/src/endpoints/__tests__/Endpoint.manifest.spec.ts +176 -0
- package/src/endpoints/__tests__/EndpointFactory.authorizers.spec.ts +259 -0
- package/src/endpoints/__tests__/EndpointFactory.reference-audit.spec.ts +190 -0
- package/src/endpoints/__tests__/EndpointFactory.state-isolation.spec.ts +155 -0
- package/src/endpoints/__tests__/TestEndpointAdaptor.spec.ts +309 -42
- package/src/functions/Function.ts +12 -2
- package/src/functions/FunctionBuilder.ts +9 -0
- package/src/functions/__tests__/FunctionBuilder.state-isolation.spec.ts +160 -0
- package/dist/Construct-BSEs6uwW.cjs.map +0 -1
- package/dist/Construct-BbKCIPQm.mjs.map +0 -1
- package/dist/Cron-D6MyCqby.cjs.map +0 -1
- package/dist/Cron-z0RiwSnT.mjs.map +0 -1
- package/dist/CronBuilder-BLTgwOWp.mjs.map +0 -1
- package/dist/CronBuilder-BOsYnZIm.cjs.map +0 -1
- package/dist/Endpoint-COGAflGh.cjs.map +0 -1
- package/dist/Endpoint-DLLZvqoh.mjs.map +0 -1
- package/dist/EndpointBuilder-DUE8ETVR.cjs.map +0 -1
- package/dist/EndpointBuilder-DpmUw--c.mjs.map +0 -1
- package/dist/EndpointFactory-CuJUCyvZ.mjs.map +0 -1
- package/dist/EndpointFactory-YAR24M2i.cjs.map +0 -1
- package/dist/Function-C5mW-38v.mjs.map +0 -1
- package/dist/Function-CbO2NZx-.cjs.map +0 -1
- package/dist/FunctionBuilder-CosgPmMl.mjs.map +0 -1
- package/dist/FunctionBuilder-DuOeWCAl.cjs.map +0 -1
- package/dist/HonoEndpointAdaptor-BlT1rWHV.mjs.map +0 -1
- package/dist/HonoEndpointAdaptor-Ds433Q8w.cjs.map +0 -1
- package/dist/TestEndpointAdaptor-BG6fzAOx.mjs.map +0 -1
- package/dist/TestEndpointAdaptor-BaQaTy_1.cjs.map +0 -1
- package/dist/functions-mM-jcphA.mjs +0 -8
- package/dist/index-BXTN4mwI.d.mts +0 -9
- package/dist/index-BxApEwAF.d.cts +0 -9
|
@@ -14,12 +14,55 @@ import type { StandardSchemaV1 } from '@standard-schema/spec';
|
|
|
14
14
|
import { publishConstructEvents } from '../publisher';
|
|
15
15
|
import type { HttpMethod } from '../types';
|
|
16
16
|
import {
|
|
17
|
+
type CookieOptions,
|
|
17
18
|
Endpoint,
|
|
18
19
|
type EndpointSchemas,
|
|
19
20
|
ResponseBuilder,
|
|
20
|
-
type ResponseWithMetadata,
|
|
21
21
|
} from './Endpoint';
|
|
22
22
|
|
|
23
|
+
export type TestHttpResponse<TBody = any> = {
|
|
24
|
+
body: TBody;
|
|
25
|
+
status: number;
|
|
26
|
+
headers: Record<string, string | string[]>;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Serializes a cookie into a Set-Cookie header string
|
|
31
|
+
*/
|
|
32
|
+
function serializeCookie(
|
|
33
|
+
name: string,
|
|
34
|
+
value: string,
|
|
35
|
+
options?: CookieOptions,
|
|
36
|
+
): string {
|
|
37
|
+
let cookieString = `${name}=${value}`;
|
|
38
|
+
|
|
39
|
+
if (options) {
|
|
40
|
+
if (options.maxAge !== undefined) {
|
|
41
|
+
cookieString += `; Max-Age=${options.maxAge}`;
|
|
42
|
+
}
|
|
43
|
+
if (options.expires) {
|
|
44
|
+
cookieString += `; Expires=${options.expires.toUTCString()}`;
|
|
45
|
+
}
|
|
46
|
+
if (options.domain) {
|
|
47
|
+
cookieString += `; Domain=${options.domain}`;
|
|
48
|
+
}
|
|
49
|
+
if (options.path) {
|
|
50
|
+
cookieString += `; Path=${options.path}`;
|
|
51
|
+
}
|
|
52
|
+
if (options.httpOnly) {
|
|
53
|
+
cookieString += '; HttpOnly';
|
|
54
|
+
}
|
|
55
|
+
if (options.secure) {
|
|
56
|
+
cookieString += '; Secure';
|
|
57
|
+
}
|
|
58
|
+
if (options.sameSite) {
|
|
59
|
+
cookieString += `; SameSite=${options.sameSite}`;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return cookieString;
|
|
64
|
+
}
|
|
65
|
+
|
|
23
66
|
export class TestEndpointAdaptor<
|
|
24
67
|
TRoute extends string,
|
|
25
68
|
TMethod extends HttpMethod,
|
|
@@ -77,17 +120,14 @@ export class TestEndpointAdaptor<
|
|
|
77
120
|
> = TestEndpointAdaptor.getDefaultServiceDiscover(endpoint),
|
|
78
121
|
) {}
|
|
79
122
|
|
|
80
|
-
async
|
|
123
|
+
async fullRequest(
|
|
81
124
|
ctx: TestRequestAdaptor<
|
|
82
125
|
TInput,
|
|
83
126
|
TServices,
|
|
84
127
|
TEventPublisher,
|
|
85
128
|
TEventPublisherServiceName
|
|
86
129
|
>,
|
|
87
|
-
): Promise<
|
|
88
|
-
| InferStandardSchema<TOutSchema>
|
|
89
|
-
| ResponseWithMetadata<InferStandardSchema<TOutSchema>>
|
|
90
|
-
> {
|
|
130
|
+
): Promise<TestHttpResponse<InferStandardSchema<TOutSchema>>> {
|
|
91
131
|
const body = await this.endpoint.parseInput((ctx as any).body, 'body');
|
|
92
132
|
const query = await this.endpoint.parseInput((ctx as any).query, 'query');
|
|
93
133
|
const params = await this.endpoint.parseInput(
|
|
@@ -138,16 +178,37 @@ export class TestEndpointAdaptor<
|
|
|
138
178
|
|
|
139
179
|
await publishConstructEvents(this.endpoint, output, this.serviceDiscovery);
|
|
140
180
|
|
|
141
|
-
//
|
|
142
|
-
|
|
143
|
-
(metadata.headers
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
) {
|
|
147
|
-
|
|
181
|
+
// Convert cookies to Set-Cookie headers
|
|
182
|
+
const headers: Record<string, string | string[]> = {
|
|
183
|
+
...(metadata.headers || {}),
|
|
184
|
+
};
|
|
185
|
+
|
|
186
|
+
if (metadata.cookies && metadata.cookies.size > 0) {
|
|
187
|
+
const setCookieValues: string[] = [];
|
|
188
|
+
for (const [name, cookie] of metadata.cookies.entries()) {
|
|
189
|
+
setCookieValues.push(serializeCookie(name, cookie.value, cookie.options));
|
|
190
|
+
}
|
|
191
|
+
headers['set-cookie'] = setCookieValues;
|
|
148
192
|
}
|
|
149
193
|
|
|
150
|
-
|
|
194
|
+
// Return HTTP response format
|
|
195
|
+
return {
|
|
196
|
+
body: output,
|
|
197
|
+
status: metadata.status || 200,
|
|
198
|
+
headers,
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
async request(
|
|
203
|
+
ctx: TestRequestAdaptor<
|
|
204
|
+
TInput,
|
|
205
|
+
TServices,
|
|
206
|
+
TEventPublisher,
|
|
207
|
+
TEventPublisherServiceName
|
|
208
|
+
>,
|
|
209
|
+
): Promise<InferStandardSchema<TOutSchema>> {
|
|
210
|
+
const response = await this.fullRequest(ctx);
|
|
211
|
+
return response.body;
|
|
151
212
|
}
|
|
152
213
|
}
|
|
153
214
|
|
|
@@ -117,4 +117,89 @@ describe('Endpoint.createCookies', () => {
|
|
|
117
117
|
expect(cookieFn('_ga')).toBe('GA1.2.123456789.1234567890');
|
|
118
118
|
expect(cookieFn('authenticated')).toBe('true');
|
|
119
119
|
});
|
|
120
|
+
|
|
121
|
+
describe('cookie() - get all cookies', () => {
|
|
122
|
+
it('should return all cookies as object when called without arguments', () => {
|
|
123
|
+
const cookieFn = Endpoint.createCookies(
|
|
124
|
+
'session=abc123; theme=dark; lang=en',
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
const allCookies = cookieFn();
|
|
128
|
+
|
|
129
|
+
expect(allCookies).toEqual({
|
|
130
|
+
session: 'abc123',
|
|
131
|
+
theme: 'dark',
|
|
132
|
+
lang: 'en',
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it('should return empty object when no cookies exist', () => {
|
|
137
|
+
const cookieFn = Endpoint.createCookies(undefined);
|
|
138
|
+
|
|
139
|
+
const allCookies = cookieFn();
|
|
140
|
+
|
|
141
|
+
expect(allCookies).toEqual({});
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
it('should return empty object for empty cookie string', () => {
|
|
145
|
+
const cookieFn = Endpoint.createCookies('');
|
|
146
|
+
|
|
147
|
+
const allCookies = cookieFn();
|
|
148
|
+
|
|
149
|
+
expect(allCookies).toEqual({});
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
it('should decode URL-encoded values in all cookies', () => {
|
|
153
|
+
const cookieFn = Endpoint.createCookies(
|
|
154
|
+
'user=John%20Doe; email=john%40example.com',
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
const allCookies = cookieFn();
|
|
158
|
+
|
|
159
|
+
expect(allCookies).toEqual({
|
|
160
|
+
user: 'John Doe',
|
|
161
|
+
email: 'john@example.com',
|
|
162
|
+
});
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
it('should preserve case in cookie names when getting all', () => {
|
|
166
|
+
const cookieFn = Endpoint.createCookies('Session=abc; session=xyz; TOKEN=123');
|
|
167
|
+
|
|
168
|
+
const allCookies = cookieFn();
|
|
169
|
+
|
|
170
|
+
expect(allCookies).toEqual({
|
|
171
|
+
Session: 'abc',
|
|
172
|
+
session: 'xyz',
|
|
173
|
+
TOKEN: '123',
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
|
|
177
|
+
it('should handle cookies with equals sign in values', () => {
|
|
178
|
+
const cookieFn = Endpoint.createCookies(
|
|
179
|
+
'data=key=value; token=abc=123=xyz',
|
|
180
|
+
);
|
|
181
|
+
|
|
182
|
+
const allCookies = cookieFn();
|
|
183
|
+
|
|
184
|
+
expect(allCookies).toEqual({
|
|
185
|
+
data: 'key=value',
|
|
186
|
+
token: 'abc=123=xyz',
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
|
|
190
|
+
it('should work with complex real-world cookie string', () => {
|
|
191
|
+
const cookieFn = Endpoint.createCookies(
|
|
192
|
+
'session=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9; user_id=12345; preferences=%7B%22theme%22%3A%22dark%22%7D; authenticated=true',
|
|
193
|
+
);
|
|
194
|
+
|
|
195
|
+
const allCookies = cookieFn();
|
|
196
|
+
|
|
197
|
+
expect(allCookies).toEqual({
|
|
198
|
+
session: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
|
|
199
|
+
user_id: '12345',
|
|
200
|
+
preferences: '{"theme":"dark"}',
|
|
201
|
+
authenticated: 'true',
|
|
202
|
+
});
|
|
203
|
+
});
|
|
204
|
+
});
|
|
120
205
|
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { Endpoint } from '../Endpoint';
|
|
3
|
+
|
|
4
|
+
describe('Endpoint.createHeaders', () => {
|
|
5
|
+
it('should get single header value', () => {
|
|
6
|
+
const headerFn = Endpoint.createHeaders({
|
|
7
|
+
'Content-Type': 'application/json',
|
|
8
|
+
Host: 'example.com',
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
expect(headerFn('content-type')).toBe('application/json');
|
|
12
|
+
expect(headerFn('host')).toBe('example.com');
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
it('should be case-insensitive for header names', () => {
|
|
16
|
+
const headerFn = Endpoint.createHeaders({
|
|
17
|
+
'Content-Type': 'application/json',
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
expect(headerFn('content-type')).toBe('application/json');
|
|
21
|
+
expect(headerFn('Content-Type')).toBe('application/json');
|
|
22
|
+
expect(headerFn('CONTENT-TYPE')).toBe('application/json');
|
|
23
|
+
expect(headerFn('CoNtEnT-tYpE')).toBe('application/json');
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
it('should return undefined for non-existent header', () => {
|
|
27
|
+
const headerFn = Endpoint.createHeaders({
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
expect(headerFn('Authorization')).toBeUndefined();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
it('should handle empty headers object', () => {
|
|
35
|
+
const headerFn = Endpoint.createHeaders({});
|
|
36
|
+
|
|
37
|
+
expect(headerFn('Content-Type')).toBeUndefined();
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
it('should handle headers with special characters', () => {
|
|
41
|
+
const headerFn = Endpoint.createHeaders({
|
|
42
|
+
'X-Custom-Header': 'value-with-dashes',
|
|
43
|
+
'X-Request-ID': '12345-67890-abcdef',
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
expect(headerFn('x-custom-header')).toBe('value-with-dashes');
|
|
47
|
+
expect(headerFn('X-REQUEST-ID')).toBe('12345-67890-abcdef');
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
it('should handle standard HTTP headers', () => {
|
|
51
|
+
const headerFn = Endpoint.createHeaders({
|
|
52
|
+
'Content-Type': 'application/json',
|
|
53
|
+
'Content-Length': '1234',
|
|
54
|
+
Authorization: 'Bearer token123',
|
|
55
|
+
'User-Agent': 'Mozilla/5.0',
|
|
56
|
+
Accept: 'application/json',
|
|
57
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
58
|
+
'Cache-Control': 'no-cache',
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
expect(headerFn('content-type')).toBe('application/json');
|
|
62
|
+
expect(headerFn('content-length')).toBe('1234');
|
|
63
|
+
expect(headerFn('authorization')).toBe('Bearer token123');
|
|
64
|
+
expect(headerFn('user-agent')).toBe('Mozilla/5.0');
|
|
65
|
+
expect(headerFn('accept')).toBe('application/json');
|
|
66
|
+
expect(headerFn('accept-language')).toBe('en-US,en;q=0.9');
|
|
67
|
+
expect(headerFn('cache-control')).toBe('no-cache');
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
it('should handle forwarded headers', () => {
|
|
71
|
+
const headerFn = Endpoint.createHeaders({
|
|
72
|
+
'X-Forwarded-For': '203.0.113.1',
|
|
73
|
+
'X-Forwarded-Proto': 'https',
|
|
74
|
+
'X-Real-IP': '203.0.113.1',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(headerFn('x-forwarded-for')).toBe('203.0.113.1');
|
|
78
|
+
expect(headerFn('x-forwarded-proto')).toBe('https');
|
|
79
|
+
expect(headerFn('x-real-ip')).toBe('203.0.113.1');
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('header() - get all headers', () => {
|
|
83
|
+
it('should return all headers as object when called without arguments', () => {
|
|
84
|
+
const headerFn = Endpoint.createHeaders({
|
|
85
|
+
'Content-Type': 'application/json',
|
|
86
|
+
Host: 'example.com',
|
|
87
|
+
Authorization: 'Bearer token123',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const allHeaders = headerFn();
|
|
91
|
+
|
|
92
|
+
expect(allHeaders).toEqual({
|
|
93
|
+
'content-type': 'application/json',
|
|
94
|
+
host: 'example.com',
|
|
95
|
+
authorization: 'Bearer token123',
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('should return empty object when no headers exist', () => {
|
|
100
|
+
const headerFn = Endpoint.createHeaders({});
|
|
101
|
+
|
|
102
|
+
const allHeaders = headerFn();
|
|
103
|
+
|
|
104
|
+
expect(allHeaders).toEqual({});
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should normalize all header names to lowercase', () => {
|
|
108
|
+
const headerFn = Endpoint.createHeaders({
|
|
109
|
+
'Content-Type': 'application/json',
|
|
110
|
+
HOST: 'example.com',
|
|
111
|
+
'X-Custom-Header': 'value',
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const allHeaders = headerFn();
|
|
115
|
+
|
|
116
|
+
expect(allHeaders).toEqual({
|
|
117
|
+
'content-type': 'application/json',
|
|
118
|
+
host: 'example.com',
|
|
119
|
+
'x-custom-header': 'value',
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
it('should work with standard HTTP headers', () => {
|
|
124
|
+
const headerFn = Endpoint.createHeaders({
|
|
125
|
+
'Content-Type': 'application/json',
|
|
126
|
+
'Content-Length': '1234',
|
|
127
|
+
Authorization: 'Bearer token123',
|
|
128
|
+
'User-Agent': 'Mozilla/5.0',
|
|
129
|
+
Accept: 'application/json',
|
|
130
|
+
});
|
|
131
|
+
|
|
132
|
+
const allHeaders = headerFn();
|
|
133
|
+
|
|
134
|
+
expect(allHeaders).toEqual({
|
|
135
|
+
'content-type': 'application/json',
|
|
136
|
+
'content-length': '1234',
|
|
137
|
+
authorization: 'Bearer token123',
|
|
138
|
+
'user-agent': 'Mozilla/5.0',
|
|
139
|
+
accept: 'application/json',
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it('should work with custom and forwarded headers', () => {
|
|
144
|
+
const headerFn = Endpoint.createHeaders({
|
|
145
|
+
'X-Forwarded-For': '203.0.113.1',
|
|
146
|
+
'X-Forwarded-Proto': 'https',
|
|
147
|
+
'X-Request-ID': 'req-123',
|
|
148
|
+
'X-Custom-Header': 'custom-value',
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
const allHeaders = headerFn();
|
|
152
|
+
|
|
153
|
+
expect(allHeaders).toEqual({
|
|
154
|
+
'x-forwarded-for': '203.0.113.1',
|
|
155
|
+
'x-forwarded-proto': 'https',
|
|
156
|
+
'x-request-id': 'req-123',
|
|
157
|
+
'x-custom-header': 'custom-value',
|
|
158
|
+
});
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
it('should handle complex real-world headers', () => {
|
|
162
|
+
const headerFn = Endpoint.createHeaders({
|
|
163
|
+
'Content-Type': 'application/json; charset=utf-8',
|
|
164
|
+
Host: 'api.example.com',
|
|
165
|
+
Connection: 'keep-alive',
|
|
166
|
+
'User-Agent':
|
|
167
|
+
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
|
168
|
+
Accept: '*/*',
|
|
169
|
+
'Accept-Encoding': 'gzip, deflate, br',
|
|
170
|
+
'Accept-Language': 'en-US,en;q=0.9',
|
|
171
|
+
Authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
|
|
172
|
+
'Cache-Control': 'no-cache',
|
|
173
|
+
Origin: 'https://example.com',
|
|
174
|
+
Referer: 'https://example.com/dashboard',
|
|
175
|
+
'X-Requested-With': 'XMLHttpRequest',
|
|
176
|
+
});
|
|
177
|
+
|
|
178
|
+
const allHeaders = headerFn();
|
|
179
|
+
|
|
180
|
+
expect(allHeaders).toHaveProperty('content-type');
|
|
181
|
+
expect(allHeaders).toHaveProperty('host');
|
|
182
|
+
expect(allHeaders).toHaveProperty('authorization');
|
|
183
|
+
expect(allHeaders).toHaveProperty('user-agent');
|
|
184
|
+
expect(Object.keys(allHeaders).length).toBe(12);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
});
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest';
|
|
2
|
+
import { Endpoint } from '../Endpoint';
|
|
3
|
+
import { SuccessStatus } from '../Endpoint';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
|
|
6
|
+
describe('Endpoint manifest fields', () => {
|
|
7
|
+
it('should store timeout and memorySize', () => {
|
|
8
|
+
const endpoint = new Endpoint({
|
|
9
|
+
route: '/users/:id',
|
|
10
|
+
method: 'GET',
|
|
11
|
+
fn: async () => ({ id: '123' }),
|
|
12
|
+
authorize: undefined,
|
|
13
|
+
description: 'Get user by ID',
|
|
14
|
+
timeout: 30000,
|
|
15
|
+
memorySize: 512,
|
|
16
|
+
input: undefined,
|
|
17
|
+
output: undefined,
|
|
18
|
+
services: [],
|
|
19
|
+
logger: {} as any,
|
|
20
|
+
getSession: undefined,
|
|
21
|
+
rateLimit: undefined,
|
|
22
|
+
status: SuccessStatus.OK,
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
expect(endpoint.timeout).toBe(30000);
|
|
26
|
+
expect(endpoint.memorySize).toBe(512);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('should store authorizer information', () => {
|
|
30
|
+
const endpoint = new Endpoint({
|
|
31
|
+
route: '/admin/users',
|
|
32
|
+
method: 'POST',
|
|
33
|
+
fn: async () => ({ success: true }),
|
|
34
|
+
authorize: undefined,
|
|
35
|
+
description: 'Create admin user',
|
|
36
|
+
timeout: undefined,
|
|
37
|
+
memorySize: undefined,
|
|
38
|
+
input: undefined,
|
|
39
|
+
output: undefined,
|
|
40
|
+
services: [],
|
|
41
|
+
logger: {} as any,
|
|
42
|
+
getSession: undefined,
|
|
43
|
+
rateLimit: undefined,
|
|
44
|
+
status: SuccessStatus.Created,
|
|
45
|
+
authorizer: {
|
|
46
|
+
name: 'iam',
|
|
47
|
+
type: 'AWS_IAM',
|
|
48
|
+
description: 'IAM-based authorizer',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
expect(endpoint.authorizer).toEqual({
|
|
53
|
+
name: 'iam',
|
|
54
|
+
type: 'AWS_IAM',
|
|
55
|
+
description: 'IAM-based authorizer',
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
it('should have undefined authorizer when not provided', () => {
|
|
60
|
+
const endpoint = new Endpoint({
|
|
61
|
+
route: '/public',
|
|
62
|
+
method: 'GET',
|
|
63
|
+
fn: async () => ({ data: 'public' }),
|
|
64
|
+
authorize: undefined,
|
|
65
|
+
description: 'Public endpoint',
|
|
66
|
+
timeout: undefined,
|
|
67
|
+
memorySize: undefined,
|
|
68
|
+
input: undefined,
|
|
69
|
+
output: undefined,
|
|
70
|
+
services: [],
|
|
71
|
+
logger: {} as any,
|
|
72
|
+
getSession: undefined,
|
|
73
|
+
rateLimit: undefined,
|
|
74
|
+
status: SuccessStatus.OK,
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
expect(endpoint.authorizer).toBeUndefined();
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
it('should store all manifest fields together', () => {
|
|
81
|
+
const bodySchema = z.object({ name: z.string() });
|
|
82
|
+
const outputSchema = z.object({ id: z.string(), name: z.string() });
|
|
83
|
+
|
|
84
|
+
const endpoint = new Endpoint({
|
|
85
|
+
route: '/api/v1/users',
|
|
86
|
+
method: 'POST',
|
|
87
|
+
fn: async () => ({ id: '123', name: 'Test User' }),
|
|
88
|
+
authorize: undefined,
|
|
89
|
+
description: 'Create a new user',
|
|
90
|
+
tags: ['users', 'admin'],
|
|
91
|
+
timeout: 15000,
|
|
92
|
+
memorySize: 256,
|
|
93
|
+
input: { body: bodySchema },
|
|
94
|
+
output: outputSchema,
|
|
95
|
+
services: [],
|
|
96
|
+
logger: {} as any,
|
|
97
|
+
getSession: undefined,
|
|
98
|
+
rateLimit: undefined,
|
|
99
|
+
status: SuccessStatus.Created,
|
|
100
|
+
authorizer: {
|
|
101
|
+
name: 'jwt-auth0',
|
|
102
|
+
type: 'JWT',
|
|
103
|
+
description: 'Auth0 JWT authorizer',
|
|
104
|
+
metadata: {
|
|
105
|
+
audience: 'https://api.example.com',
|
|
106
|
+
issuer: 'https://example.auth0.com/',
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
expect(endpoint.route).toBe('/api/v1/users');
|
|
112
|
+
expect(endpoint.method).toBe('POST');
|
|
113
|
+
expect(endpoint.description).toBe('Create a new user');
|
|
114
|
+
expect(endpoint.tags).toEqual(['users', 'admin']);
|
|
115
|
+
expect(endpoint.timeout).toBe(15000);
|
|
116
|
+
expect(endpoint.memorySize).toBe(256);
|
|
117
|
+
expect(endpoint.status).toBe(SuccessStatus.Created);
|
|
118
|
+
expect(endpoint.authorizer).toEqual({
|
|
119
|
+
name: 'jwt-auth0',
|
|
120
|
+
type: 'JWT',
|
|
121
|
+
description: 'Auth0 JWT authorizer',
|
|
122
|
+
metadata: {
|
|
123
|
+
audience: 'https://api.example.com',
|
|
124
|
+
issuer: 'https://example.auth0.com/',
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
it('should preserve authorizer metadata with minimal fields', () => {
|
|
130
|
+
const endpoint = new Endpoint({
|
|
131
|
+
route: '/protected',
|
|
132
|
+
method: 'GET',
|
|
133
|
+
fn: async () => ({ data: 'secret' }),
|
|
134
|
+
authorize: undefined,
|
|
135
|
+
description: undefined,
|
|
136
|
+
timeout: undefined,
|
|
137
|
+
memorySize: undefined,
|
|
138
|
+
input: undefined,
|
|
139
|
+
output: undefined,
|
|
140
|
+
services: [],
|
|
141
|
+
logger: {} as any,
|
|
142
|
+
getSession: undefined,
|
|
143
|
+
rateLimit: undefined,
|
|
144
|
+
status: SuccessStatus.OK,
|
|
145
|
+
authorizer: {
|
|
146
|
+
name: 'custom',
|
|
147
|
+
},
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
expect(endpoint.authorizer).toEqual({ name: 'custom' });
|
|
151
|
+
});
|
|
152
|
+
|
|
153
|
+
it('should handle default timeout and memorySize values', () => {
|
|
154
|
+
const endpoint = new Endpoint({
|
|
155
|
+
route: '/default',
|
|
156
|
+
method: 'GET',
|
|
157
|
+
fn: async () => ({ data: 'default' }),
|
|
158
|
+
authorize: undefined,
|
|
159
|
+
description: undefined,
|
|
160
|
+
timeout: undefined,
|
|
161
|
+
memorySize: undefined,
|
|
162
|
+
input: undefined,
|
|
163
|
+
output: undefined,
|
|
164
|
+
services: [],
|
|
165
|
+
logger: {} as any,
|
|
166
|
+
getSession: undefined,
|
|
167
|
+
rateLimit: undefined,
|
|
168
|
+
status: SuccessStatus.OK,
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
// Default timeout is 30000ms (30 seconds)
|
|
172
|
+
expect(endpoint.timeout).toBe(30000);
|
|
173
|
+
// Default memorySize is undefined
|
|
174
|
+
expect(endpoint.memorySize).toBeUndefined();
|
|
175
|
+
});
|
|
176
|
+
});
|